[wp-trac] [WordPress Trac] #34918: Orphaned Comments From Nonexistent Post Type Causes Capability Warnings in Admin

WordPress Trac noreply at wordpress.org
Tue Dec 8 17:54:41 UTC 2015


#34918: Orphaned Comments From Nonexistent Post Type Causes Capability Warnings in
Admin
----------------------------+-----------------------------
 Reporter:  Funkatronic     |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Comments        |    Version:  trunk
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 So I have a comment or two attached to a post type that isn't currently
 active.  Because the post type isn't turned on, I'm getting the following
 warnings in the admin screen whenever the comment is displayed:


 {{{
 Notice: map_meta_cap was called <strong>incorrectly</strong>. The post
 type series_season is not registered, so it may not be reliable to check
 the capability "edit_post" against a post of that type. Please see <a
 href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in
 WordPress</a> for more information. (This message was added in version
 4.4.0.) in D:\Web Development\www\beta\wp-includes\functions.php on line
 3787
 }}}

 [[Image(http://crosseyedeveloper.com/wp-
 content/uploads/2015/12/commentcap.jpg)]]

 It also shows up on the Dashboard in the comments widget:
 [[Image(http://crosseyedeveloper.com/wp-
 content/uploads/2015/12/commentcap21.jpg)]]

 I think this is related to https://core.trac.wordpress.org/ticket/16956
 (thanks @boonebgorges).  Basically, because the post type doesn't exist
 anymore, the it messes up the capabilities of a comment that is attached
 to a post of that post type.  I suggest maybe hiding the comments of post
 types that don't exist/inactive.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34918>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list