[wp-trac] [WordPress Trac] #38323: Reconsider $object_subtype handling in `register_meta()`

WordPress Trac noreply at wordpress.org
Thu Jun 21 21:06:52 UTC 2018


#38323: Reconsider $object_subtype handling in `register_meta()`
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  kadamwhite
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  5.0
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note has-unit-   |     Focuses:  rest-api
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by kadamwhite):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"43378" 43378]:
 {{{
 #!CommitTicketReference repository="" revision="43378"
 REST API: Support meta registration for specific object subtypes.

 Introduce an `object_subtype` argument to the args array for
 `register_meta()` which can be used to limit meta registration to a single
 subtype (e.g. a custom post type or taxonomy, vs all posts or taxonomies).

 Introduce `register_post_meta()` and `register_term_meta()` wrapper
 methods for `register_meta` to provide a convenient interface for the
 common case of registering meta for a specific taxonomy or post type.
 These methods work the way plugin developers have often expected
 `register_meta` to function, and should be used in place of direct
 `register_meta` where possible.

 Props flixos90, tharsheblows, spacedmonkey.
 Fixes #38323.
 }}}

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


More information about the wp-trac mailing list