[wp-trac] [WordPress Trac] #55445: Should WP_Post_Type preserve Array of capability_type?

WordPress Trac noreply at wordpress.org
Sat Sep 13 10:39:28 UTC 2025


#55445: Should WP_Post_Type preserve Array of capability_type?
-------------------------------+----------------------
 Reporter:  Howdy_McGee        |       Owner:  (none)
     Type:  defect (bug)       |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  minor              |  Resolution:  wontfix
 Keywords:                     |     Focuses:
-------------------------------+----------------------
Changes (by SirLouen):

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


Comment:

 https://developer.wordpress.org/reference/functions/get_post_type_capabilities/

 By default WordPress uses singular, but if it has to use the plural for
 some specific capability that requires such, it will take the singular
 version with the "s" by the end.

 Adding the plural explicitely is just to avoid this "s"-suffix behaviour,
 not to reference it at your convenience. Everything is preset and it will
 use the singular version when singular is hardcoded and the plural where
 plural is hardcoded.

 [https://github.com/SirLouen/wordpress-
 develop/blob/f57cf3d104de569607b47ec0b87415384a642f90/src/wp-
 includes/post.php#L1980-L1992 Check this code snippet] as a good example

 As you can see, some capabilities are being referenced in the
 `singular_base` and others in the `plural_base`. This is what
 `capability_type` `array` is meant for.

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


More information about the wp-trac mailing list