Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#33172 new defect (bug)

Notice in get_bulk_actions() in certain conditions

Reported by: creativejuiz's profile CreativeJuiz Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Quick/Bulk Edit Keywords:
Focuses: administration Cc:


Hi there,

When a custom post type declaration is made with custom capabilities, the delete_posts cap can be missing.

If it's the case, the get_bulk_actions() function create a PHP Notice saying the following:

Notice: Undefined property: stdClass::$delete_posts in /wordpress/wp-admin/includes/class-wp-posts-list-table.php on line 251

To prevent and avoid this notice, I simply use isset() to check the definition. (see patch in attachment)

Thank you.

Attachments (1)

33172.patch (565 bytes) - added by CreativeJuiz 9 years ago.
Patch for class-wp-posts-list-table.php

Download all attachments as: .zip

Change History (3)

9 years ago

Patch for class-wp-posts-list-table.php

This ticket was mentioned in Slack in #core by obenland. View the logs.

9 years ago

#2 @obenland
9 years ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.