WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 6 months ago

#33172 new defect (bug)

Notice in get_bulk_actions() in certain conditions

Reported by: CreativeJuiz Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Quick/Bulk Edit Keywords:
Focuses: administration Cc:
PR Number:

Description

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 4 years ago.
Patch for class-wp-posts-list-table.php

Download all attachments as: .zip

Change History (3)

@CreativeJuiz
4 years ago

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

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


4 years ago

#2 @obenland
4 years ago

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