Undefined property: stdClass::$delete_posts in class-wp-posts-list-table.php
-
Hi,
The plugin throws noticeNotice: Undefined property: stdClass::$delete_posts in wp-admin/includes/class-wp-posts-list-table.php on line 400
The reason is there is a check is WP_Posts_List_Table::get_bulk_actions like this
if ( current_user_can( $post_type_obj->cap->delete_posts ) ) { if ( $this->is_trash || ! EMPTY_TRASH_DAYS ) { $actions['delete'] = __( 'Delete Permanently' ); } else { $actions['trash'] = __( 'Move to Trash' ); } }
It tests for the ‘delete_posts’ capability which is not present on the “deprecated_log” post type object.
This can be fixed by adding the capability when registering deprecated_log post type.
'capabilities' => array( 'edit_post' => 'activate_plugins', 'edit_posts' => 'activate_plugins', 'edit_others_posts' => 'activate_plugins', 'publish_posts' => 'do_not_allow', 'read_post' => 'activate_plugins', 'read_private_posts' => 'do_not_allow', 'delete_post' => 'activate_plugins', 'delete_posts' => 'activate_plugins', //added. ),
Please fix the notice.
Thank you for the wonderful plugin.
Regards
Brajesh
- The topic ‘Undefined property: stdClass::$delete_posts in class-wp-posts-list-table.php’ is closed to new replies.