WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #47836


Ignore:
Timestamp:
08/05/2019 06:02:38 PM (2 years ago)
Author:
SergeyBiryukov
Comment:

Hi @AkSDvP, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #30991.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #47836

    • Property Status changed from new to closed
    • Property Component changed from General to Posts, Post Types
    • Property Milestone changed from Awaiting Review to
    • Property Keywords needs-patch removed
    • Property Resolution changed from to duplicate
  • Ticket #47836 – Description

    initial v1  
    33Following PHP warning is being observed while rendering Manage Posts links in the admin section.
    44
    5 PHP Notice:  Undefined property: stdClass::$delete_posts in /var/www/html/wp-sandbox/wp-admin/includes/class-wp-posts-list-table.php on line 413
     5`PHP Notice:  Undefined property: stdClass::$delete_posts in /var/www/html/wp-sandbox/wp-admin/includes/class-wp-posts-list-table.php on line 413`
    66
    77I would suggest to include isset() check statement to check if ($post_type_obj->cap->delete_posts) exists, before the current condition, that I think will handle the warning.
    88
    99So I suggest modifying the following code -
    10 
     10{{{
    1111                if ( current_user_can( $post_type_obj->cap->delete_posts ) ) {
    1212                        if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) {
     
    1616                        }
    1717                }
    18 
     18}}}
    1919with
    20 
     20{{{
    2121                if ( isset( $post_type_obj->cap->delete_posts ) ) {
    2222
     
    2929                        }
    3030                }
    31 
     31}}}
    3232Please find the source code link for reference.
    3333