[wp-trac] [WordPress Trac] #30991: Post type object capability 'delete_posts' is referenced in the posts list table but does not exist unless 'map_meta_cap' is set to true for post type

WordPress Trac noreply at wordpress.org
Wed Jan 17 18:58:42 UTC 2018


#30991: Post type object capability 'delete_posts' is referenced in the posts list
table but does not exist unless 'map_meta_cap' is set to true for post type
------------------------------------+-----------------------------
 Reporter:  bamadesigner            |       Owner:  SergeyBiryukov
     Type:  defect (bug)            |      Status:  reviewing
 Priority:  normal                  |   Milestone:  Future Release
Component:  Posts, Post Types       |     Version:  4.1
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  administration
------------------------------------+-----------------------------

Comment (by Mte90):

 Just to revamp this ticket, this is the output on my plugin:


 {{{
 [17-Jan-2018 01:40:17 UTC] Array
 (
     [error] => Notice
     [file] => /home/domain/wp-admin/includes/class-wp-posts-list-table.php
     [line] => 400
     [context] => Array
         (
             [actions] => Array
                 (
                     [edit] => Edit
                 )

             [post_type_obj] => WP_Post_Type Object
                 (
                     [name] => glossary
                     [label] => Glossary Terms
                     [labels] => stdClass Object
                         (
                             [name] => Glossary Terms
                             [singular_name] => Glossary Term
                             [add_new] => Add New Glossary Term
                             [add_new_item] => Add New Glossary Term
                             [edit_item] => Edit Glossary Term
                             [new_item] => New Glossary Term
                             [view_item] => View Glossary Term
                             [view_items] => View Posts
                             [search_items] => Search Glossary Terms
                             [not_found] => No Glossary Terms
                             [not_found_in_trash] => No Glossary Terms
 found in Trash
                             [parent_item_colon] =>
                             [all_items] => All Glossary Terms
                             [archives] => All Glossary Terms
                             [attributes] => Post Attributes
                             [insert_into_item] => Insert into post
                             [uploaded_to_this_item] => Uploaded to this
 post
                             [featured_image] => Featured Image
                             [set_featured_image] => Set featured image
                             [remove_featured_image] => Remove featured
 image
                             [use_featured_image] => Use as featured image
                             [filter_items_list] => Filter posts list
                             [items_list_navigation] => Posts list
 navigation
                             [items_list] => Posts list
                             [menu_name] => Glossary Terms
                             [name_admin_bar] => Glossary Term
                         )

                     [description] =>
                     [public] => 1
                     [hierarchical] =>
                     [exclude_from_search] =>
                     [publicly_queryable] => 1
                     [show_ui] => 1
                     [show_in_menu] => 1
                     [show_in_nav_menus] => 1
                     [show_in_admin_bar] => 1
                     [menu_position] =>
                     [menu_icon] => dashicons-book-alt
                     [capability_type] => glossary
                     [map_meta_cap] =>
                     [register_meta_box_cb] =>
                     [taxonomies] => Array
                         (
                             [0] => glossary-cat
                         )

                     [has_archive] => 1
                     [query_var] => glossary
                     [can_export] => 1
                     [delete_with_user] =>
                     [_builtin] =>
                     [_edit_link] => post.php?post=%d
                     [cap] => stdClass Object
                         (
                             [edit_post] => edit_glossary
                             [read_post] => read_glossary
                             [delete_post] => delete_glossary
                             [edit_posts] => edit_glossaries
                             [edit_others_posts] => edit_others_glossaries
                             [publish_posts] => publish_glossaries
                             [read_private_posts] =>
 read_private_glossaries
                             [create_posts] => edit_glossaries
                         )

                     [rewrite] => Array
                         (
                             [slug] => glossary
                             [with_front] => 1
                             [pages] => 1
                             [feeds] => 1
                             [ep_mask] => 1
                         )

                     [show_in_rest] => 1
                     [rest_base] => glossary
                     [rest_controller_class] => WP_REST_Posts_Controller
                     [yarpp_support] => 1
                 )

         )

     [url] => https://domain/glossary/wp-admin/edit.php?post_type=glossary
     [filter] =>
     [message] => Notice (8): Undefined property: stdClass::$delete_posts
 )
 }}}

 With this parameters this error happen on WordPress 4.9.2.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30991#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list