[wp-trac] [WordPress Trac] #30991: Post type object capability 'delete_posts' is referenced in the posts list table but does not exist unless 'map_meta_cap' is set to true for post type
WordPress Trac
noreply at wordpress.org
Fri Sep 20 10:23:27 UTC 2019
#30991: Post type object capability 'delete_posts' is referenced in the posts list
table but does not exist unless 'map_meta_cap' is set to true for post type
-------------------------------------------------+-------------------------
Reporter: bamadesigner | Owner: mte90
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Posts, Post Types | Version: 4.1
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests needs- | Focuses:
dev-note | administration
-------------------------------------------------+-------------------------
Changes (by johnbillion):
* keywords: has-patch dev-feedback needs-unit-tests needs-dev-note => has-
patch needs-unit-tests needs-dev-note
* owner: johnbillion => mte90
* status: accepted => assigned
Comment:
Patch looks good.
A new test is needed which:
* Registers a post type and calls `current_user_can(
$post_type_obj->cap->delete_posts )`
* Asserts the return value is correct
* Without the patch in place, the test should fail due to the PHP notice
being triggered
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30991#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list