WordPress.org

Make WordPress Core

Ticket #24246: 24246.patch

File 24246.patch, 1.1 KB (added by johnbillion, 22 months ago)
  • wp-admin/post.php

     
    225225 
    226226        $post = get_post($post_id); 
    227227 
     228        if ( !$post ) 
     229                wp_die( __('The item you are trying to move to the Trash no longer exists.') ); 
     230 
    228231        if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) 
    229232                wp_die( __('You are not allowed to move this item to the Trash.') ); 
    230233 
     
    243246case 'untrash': 
    244247        check_admin_referer('untrash-post_' . $post_id); 
    245248 
     249        if ( !$post ) 
     250                wp_die( __('The item you are trying to restore from the Trash no longer exists.') ); 
     251 
    246252        if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) 
    247253                wp_die( __('You are not allowed to move this item out of the Trash.') ); 
    248254 
     
    256262case 'delete': 
    257263        check_admin_referer('delete-post_' . $post_id); 
    258264 
     265        if ( !$post ) 
     266                wp_die( __('This item has already been deleted.') ); 
     267 
    259268        if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) 
    260269                wp_die( __('You are not allowed to delete this item.') ); 
    261270