Changeset 11749 for trunk/wp-admin/post.php
- Timestamp:
- 07/30/2009 01:39:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/post.php
r11380 r11749 117 117 118 118 if ( empty($post->ID) ) wp_die( __('You attempted to edit a post that doesn’t exist. Perhaps it was deleted?') ); 119 if ( $post->post_status == 'trash' ) wp_die( __('You can’t edit this post because it is in the Trash. Please move it out of the Trash and try again.') ); 119 120 120 121 if ( 'post' != $post->post_type ) { … … 182 183 break; 183 184 185 case 'trash': 186 $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); 187 check_admin_referer('trash-post_' . $post_id); 188 189 $post = & get_post($post_id); 190 191 if ( !current_user_can('delete_post', $post_id) ) 192 wp_die( __('You are not allowed to move this post to the trash.') ); 193 194 if ( ! wp_trash_post($post_id) ) 195 wp_die( __('Error in moving to trash...') ); 196 197 $sendback = wp_get_referer(); 198 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?trashed=1'); 199 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 200 else $sendback = add_query_arg('trashed', 1, $sendback); 201 wp_redirect($sendback); 202 exit(); 203 break; 204 205 case 'untrash': 206 $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']); 207 check_admin_referer('untrash-post_' . $post_id); 208 209 $post = & get_post($post_id); 210 211 if ( !current_user_can('delete_post', $post_id) ) 212 wp_die( __('You are not allowed to remove this post from the trash.') ); 213 214 if ( ! wp_untrash_post($post_id) ) 215 wp_die( __('Error in removing from trash...') ); 216 217 $sendback = wp_get_referer(); 218 if (strpos($sendback, 'post.php') !== false) $sendback = admin_url('edit.php?untrashed=1'); 219 elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php'); 220 else $sendback = add_query_arg('untrashed', 1, $sendback); 221 wp_redirect($sendback); 222 exit(); 223 break; 224 184 225 case 'delete': 185 226 $post_id = (isset($_GET['post'])) ? intval($_GET['post']) : intval($_POST['post_ID']);
Note: See TracChangeset
for help on using the changeset viewer.