Post type objects are reponsible for mapping their capabilities to core caps. As a result, when the post type is no longer registered, the caps are no longer mapped. This causes problems when a post is left in the database after the post type is no longer present, and WP does an 'edit_post' or other cap check against it: a PHP notice is thrown, and the cap check always fails. As a more graceful fallback, we map all post-type-dependent caps onto 'edit_others_posts', which allows highly privileged users to be able to access orphaned content (such as comments belonging to disabled post types), while minimizing the possibility of unintended privilege escalation. We also add a `_doing_it_wrong()` notice, so that developers and site administrators are aware that the cap mapping is failing in the absence of the registered post type. Props mitchoyoshitaka, DrewAPicture, imath, codeelite, boonebgorges, nofearinc, SergeyBiryukov, jorbin, dlh. Fixes #16956. Built from https://develop.svn.wordpress.org/trunk@34091 git-svn-id: http://core.svn.wordpress.org/trunk@34059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
629 B
629 B