[wp-trac] [WordPress Trac] #37667: Handle post type support in `WP_Post_Type`

WordPress Trac noreply at wordpress.org
Mon Aug 15 11:35:51 UTC 2016


#37667: Handle post type support in `WP_Post_Type`
-----------------------------------+------------------------------
 Reporter:  flixos90               |       Owner:
     Type:  enhancement            |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Posts, Post Types      |     Version:  trunk
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------
Changes (by flixos90):

 * keywords:   => has-patch 2nd-opinion


Comment:

 [attachment:37667.diff] is a patch for what the implementation of this
 proposal could look like.

 All features are stored in a private `$features` property in
 `WP_Post_Type`. The related methods explicitly handle subtypes (like we
 have for attachments with `attachment:audio` and `attachment:video`) - for
 example, calling `$attachment_post_type->supports( 'thumbnail', 'audio' )`
 would be the same as calling `post_type_supports( 'attachment:audio',
 'thumbnail' )`.

 There's a method `remove_supports()` in `WP_Post_Type` which might not be
 necessary any longer after this change. It could be left as is or
 deprecated.

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


More information about the wp-trac mailing list