[wp-trac] [WordPress Trac] #36208: Comment queries should ignore comments associated with non-active custom post types

WordPress Trac noreply at wordpress.org
Sat Jul 30 06:31:18 UTC 2022


#36208: Comment queries should ignore comments associated with non-active custom
post types
-------------------------------------------------+-------------------------
 Reporter:  Clorith                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:
Component:  Comments                             |     Version:  4.4
 Severity:  normal                               |  Resolution:
 Keywords:  needs-unit-tests bulk-reopened has-  |     Focuses:
  patch                                          |  administration
-------------------------------------------------+-------------------------

Comment (by techjewel):

 I have made a pull request regarding this issue. This PR will solve the
 PHP notice


 {{{
 PHP Notice: map_meta_cap was called <strong>incorrectly</strong>. The post
 type shop_order is not registered, so it may not be reliable to check the
 capability "edit_post" against a post of that type.
 }}}

 Now it will pass the post_type array that is only registered to WordPress.
 I am open to discussion to resolve this issue as it's annoying notice when
 we have custom post type registered before.

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


More information about the wp-trac mailing list