Make WordPress Core

Opened 6 years ago

Last modified 5 years ago

#34918 closed defect (bug)

Orphaned Comments From Nonexistent Post Type Causes Capability Warnings in Admin — at Initial Version

Reported by: Funkatronic Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: Comments Keywords: needs-patch needs-unit-tests
Focuses: administration Cc:


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


It also shows up on the Dashboard in the comments widget:

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.

Change History (0)

Note: See TracTickets for help on using tickets.