WordPress.org

Make WordPress Core

Changeset 9468


Ignore:
Timestamp:
11/01/2008 10:28:34 PM (12 years ago)
Author:
westi
Message:

Redirect correctly on page deletion. Fixes #8030.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-page-form.php

    r9451 r9468  
    180180<div id="delete-action">
    181181<?php
    182 if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
    183 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&amp;post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
     182if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
     183<a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&amp;post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n  'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n  'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
    184184<?php } ?>
    185185</div>
  • trunk/wp-admin/page.php

    r9451 r9468  
    167167
    168168    $sendback = wp_get_referer();
    169     if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page.php');
     169    if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
    170170    elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
    171171    $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback);
Note: See TracChangeset for help on using the changeset viewer.