Sergey Biryukov
46951e0b17
Posts, Post Types: Fail gracefully when checking mapped cap against unregistered post status.
...
With `map_meta_cap` enabled for a post type, the `read_post` capability for posts with a public status is supposed to be mapped to the post type's `read` capability.
When a post is left in the database after the post status is no longer present, and WP does a `read_post` check against it, a PHP notice was thrown, and the cap check always failed.
As a more graceful fallback, the cap is now mapped onto `edit_others_posts`, which allows highly privileged users to be able to access orphaned content.
A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the cap mapping is failing in the absence of the registered post status.
Follow-up to [34091], which introduced a similar approach to checking mapped caps against an unregistered post type.
Props roytanck, SergeyBiryukov.
Fixes #48653 .
Built from https://develop.svn.wordpress.org/trunk@47178
git-svn-id: http://core.svn.wordpress.org/trunk@46978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-04 22:15:08 +00:00
..
2020-01-22 22:06:21 +00:00
2020-02-04 20:16:04 +00:00
2020-01-22 22:06:21 +00:00
2020-01-29 00:45:18 +00:00
2019-10-05 14:20:59 +00:00
2020-02-04 16:43:07 +00:00
2020-01-29 00:45:18 +00:00
2019-10-06 17:14:02 +00:00
2020-02-02 05:41:03 +00:00
2019-09-23 18:17:58 +00:00
2019-12-09 16:42:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-12-12 18:02:03 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-23 00:27:05 +00:00
2020-02-03 00:14:07 +00:00
2020-02-04 22:15:08 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-10-08 17:19:04 +00:00
2020-02-02 03:27:05 +00:00
2019-11-02 20:13:02 +00:00
2019-11-01 14:57:02 +00:00
2019-10-03 15:45:59 +00:00
2019-11-05 21:27:02 +00:00
2019-10-06 15:06:03 +00:00
2019-10-04 22:19:57 +00:00
2020-01-29 00:45:18 +00:00
2019-10-06 15:06:03 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-10-27 14:09:02 +00:00
2020-01-29 00:45:18 +00:00
2019-11-05 21:27:02 +00:00
2020-01-29 00:45:18 +00:00
2019-12-06 22:43:04 +00:00
2019-11-03 16:48:00 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-03 00:19:03 +00:00
2020-02-02 04:15:03 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-21 15:41:04 +00:00
2020-01-20 03:14:06 +00:00
2020-01-29 00:45:18 +00:00
2019-09-21 17:41:57 +00:00
2020-01-29 00:45:18 +00:00
2019-10-12 18:05:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-11 18:32:05 +00:00
2020-02-01 20:32:05 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-11-11 02:43:03 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-10-26 21:09:04 +00:00
2019-10-26 21:09:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-11-04 17:50:02 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 21:38:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-03 00:19:03 +00:00
2020-02-03 00:19:03 +00:00
2020-02-03 00:19:03 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 21:38:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-02 05:34:05 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-11 18:32:05 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 21:38:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-03 00:19:03 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 21:38:04 +00:00
2019-10-08 17:19:04 +00:00
2019-11-18 16:51:02 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 21:38:04 +00:00
2020-01-29 00:45:18 +00:00
2020-02-04 21:42:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 22:01:07 +00:00
2020-02-01 22:01:07 +00:00
2020-01-11 18:32:05 +00:00
2020-02-01 21:38:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-02-02 03:08:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-10-08 17:19:04 +00:00
2019-10-08 17:19:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-10-08 17:19:04 +00:00
2020-02-02 04:15:03 +00:00
2019-10-08 17:19:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-29 00:45:18 +00:00
2019-12-28 21:20:04 +00:00
2020-01-29 00:45:18 +00:00
2020-01-30 19:17:06 +00:00
2020-01-29 00:45:18 +00:00
2020-02-01 21:38:04 +00:00
2020-01-29 00:45:18 +00:00
2020-02-04 22:15:08 +00:00
2020-01-29 00:45:18 +00:00
2020-02-04 01:14:07 +00:00