[wp-trac] [WordPress Trac] #37775: Capabilities inconsistence when registering CPT

WordPress Trac noreply at wordpress.org
Thu Nov 13 15:36:02 UTC 2025


#37775: Capabilities inconsistence when registering CPT
-------------------------------+-------------------------
 Reporter:  slaFFik            |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:  worksforme
 Keywords:                     |     Focuses:
-------------------------------+-------------------------
Changes (by SirLouen):

 * status:  new => closed
 * resolution:   => worksforme
 * milestone:  Awaiting Review =>


Comment:

 Technically, for how capabilities are designed, `false` is just treated as
 an empty value.
 If you really want to disable a capability, there is a default value
 `do_not_allow` meant for this purpose.
 The capabilities array, is meant to set specific capabilities for certain
 actions, not as a switch for such actions. I can't remember if this was
 different long time ago, and I'm not going to review the log, but
 basically this issue is not a trouble anymore, so I'm going to be closing
 this as `worksforme`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/37775#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list