829ae5f4ce
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34091 602fd350-edb4-49c9-b593-d223f7449a82 |
||
---|---|---|
.. | ||
phpunit | ||
qunit |