[wp-trac] [WordPress Trac] #44666: Don't use hardcoded delete_post capability for custom post types

WordPress Trac noreply at wordpress.org
Sun Jul 29 10:57:41 UTC 2018


#44666: Don't use hardcoded delete_post capability for custom post types
-------------------------------+-----------------------------
 Reporter:  swissspidy         |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:
 Severity:  normal             |   Keywords:  needs-patch
  Focuses:  administration     |
-------------------------------+-----------------------------
 The post list table as well as the publish meta box use the `delete_post`
 capability to check whether a user can delete or trash a post.

 However, when registering a post type with a custom capability base, e.g.
 `product`, the actual capability will be `delete_product`.

 The same goes for the capability check inside
 `attachment_submit_meta_box()` and perhaps other places too.

 Related: #30991.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44666>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list