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

WordPress Trac noreply at wordpress.org
Mon Aug 15 11:29:22 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             |   Keywords:
  Focuses:                     |
-------------------------------+-----------------------------
 Currently post type features are stored in a global variable
 `$_wp_post_type_features`. Now that we have `WP_Post_Type`, I think it
 would make sense to let the class handle this functionality. Post type
 features are part of a post type, so they should also be part of it in the
 implementation. This would also allow us to get rid of the global variable
 we currently use (note that it's private, so it's not intended to be used
 directly by other developers).

 There's a single possible caveat I would see with this implementation:
 That would be if post type support is added before the post type is even
 registered. However, I would think we might be able to change this (with a
 dev note) since it should be best practices to add post type support
 either directly (via the `supports` argument in `register_post_type()`) or
 after registering the post type. Adding a post type feature without the
 post type being registered is not logical in my opinion.

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


More information about the wp-trac mailing list