Ticket #18030: edit.diff
File edit.diff, 2.1 KB (added by , 14 years ago) |
---|
-
wp-admin/edit.php
20 20 21 21 $post_type_object = get_post_type_object( $post_type ); 22 22 23 if ( ! current_user_can($post_type_object->cap->edit_posts) )24 wp_die( __('Cheatin’ uh?'));23 if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) 24 wp_die( __('Cheatin’ uh?'), '', array( 'response' => 403 ) ); 25 25 26 26 $wp_list_table = _get_list_table('WP_Posts_List_Table'); 27 27 $pagenum = $wp_list_table->get_pagenum(); … … 77 77 case 'trash': 78 78 $trashed = 0; 79 79 foreach( (array) $post_ids as $post_id ) { 80 if ( ! current_user_can($post_type_object->cap->delete_post, $post_id) )81 wp_die( __('You are not allowed to move this item to the Trash.') );80 if ( ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) 81 wp_die( __('You are not allowed to move this item to the Trash.'), '', array( 'response' => 403 ) ); 82 82 83 83 if ( !wp_trash_post($post_id) ) 84 84 wp_die( __('Error in moving to Trash.') ); … … 90 90 case 'untrash': 91 91 $untrashed = 0; 92 92 foreach( (array) $post_ids as $post_id ) { 93 if ( ! current_user_can($post_type_object->cap->delete_post, $post_id) )94 wp_die( __('You are not allowed to restore this item from the Trash.') );93 if ( ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) 94 wp_die( __('You are not allowed to restore this item from the Trash.'), '', array( 'response' => 403 ) ); 95 95 96 96 if ( !wp_untrash_post($post_id) ) 97 97 wp_die( __('Error in restoring from Trash.') ); … … 105 105 foreach( (array) $post_ids as $post_id ) { 106 106 $post_del = & get_post($post_id); 107 107 108 if ( ! current_user_can($post_type_object->cap->delete_post, $post_id) )109 wp_die( __('You are not allowed to delete this item.') );108 if ( ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) 109 wp_die( __('You are not allowed to delete this item.'), '', array( 'response' => 403 ) ); 110 110 111 111 if ( $post_del->post_type == 'attachment' ) { 112 112 if ( ! wp_delete_attachment($post_id) )