Changeset 11749 for trunk/wp-admin/page.php
- Timestamp:
- 07/30/2009 01:39:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/page.php
r11380 r11749 84 84 85 85 if ( empty($post->ID) ) wp_die( __('You attempted to edit a page that doesn’t exist. Perhaps it was deleted?') ); 86 if ( $post->post_status == 'trash' ) wp_die( __('You can’t edit this page because it is in the Trash. Please move it out of the Trash and try again.') ); 86 87 87 88 if ( 'page' != $post->post_type ) { … … 141 142 break; 142 143 144 case 'trash': 145 $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); 146 check_admin_referer('trash-page_' . $post_id); 147 148 $post = & get_post($post_id); 149 150 if ( !current_user_can('delete_page', $page_id) ) 151 wp_die( __('You are not allowed to move this page to the trash.') ); 152 153 if ( !wp_trash_post($post_id) ) 154 wp_die( __('Error in removing from trash...') ); 155 156 $sendback = wp_get_referer(); 157 if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?trashed=1'); 158 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 159 else $sendback = add_query_arg('trashed', 1, $sendback); 160 wp_redirect($sendback); 161 exit(); 162 break; 163 164 case 'untrash': 165 $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); 166 check_admin_referer('untrash-page_' . $post_id); 167 168 $post = & get_post($post_id); 169 170 if ( !current_user_can('delete_page', $page_id) ) 171 wp_die( __('You are not allowed to remove this page form the trash.') ); 172 173 if ( !wp_untrash_post($post_id) ) 174 wp_die( __('Error in removing from trash...') ); 175 176 $sendback = wp_get_referer(); 177 if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('edit-pages.php?untrashed=1'); 178 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 179 else $sendback = add_query_arg('untrashed', 1, $sendback); 180 wp_redirect($sendback); 181 exit(); 182 break; 183 143 184 case 'delete': 144 185 $page_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
Note: See TracChangeset
for help on using the changeset viewer.