[wp-trac] [WordPress Trac] #38323: Reconsider $object_subtype handling in `register_meta()`
WordPress Trac
noreply at wordpress.org
Thu Jul 19 18:48:54 UTC 2018
#38323: Reconsider $object_subtype handling in `register_meta()`
-------------------------------------------------+-------------------------
Reporter: flixos90 | Owner: kadamwhite
Type: enhancement | Status: closed
Priority: normal | Milestone: 4.9.8
Component: Options, Meta APIs | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch needs-dev-note has-unit- | Focuses: rest-api
tests fixed-major |
-------------------------------------------------+-------------------------
Changes (by kadamwhite):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"43510" 43510]:
{{{
#!CommitTicketReference repository="" revision="43510"
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.
Merges [43378] to the 4.9 branch.
Fixes #38323.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38323#comment:92>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list