[wp-trac] [WordPress Trac] #35658: Provide additional data for registered meta through register_meta()
WordPress Trac
noreply at wordpress.org
Wed May 11 16:51:13 UTC 2016
#35658: Provide additional data for registered meta through register_meta()
-------------------------------------------------+-------------------------
Reporter: jeremyfelt | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting
Component: Options, Meta APIs | Review
Severity: normal | Version:
Keywords: needs-unit-tests needs-testing has- | Resolution:
patch rest-api | Focuses:
-------------------------------------------------+-------------------------
Comment (by sc0ttkclark):
I haven't tackled whether to remove usage of `final` or not on
WP_Meta_Manager, those decisions are above where I'm at and where I'm
focused right now ;)
https://core.trac.wordpress.org/attachment/ticket/35658/35658-objects.diff
The latest patch I am offering up allows for meta properties to be
registered with register_meta(), just like the patch from @ericlewis,
however I've moved logic from inside register_meta() into the
WP_Meta_Manager::register() to consolidate things better.
Also, while register_meta() only accepts an array, the
WP_Meta_Manager::register() method accepts an array OR object allowing for
forward-compatibility with the Fields API. In the future, register_meta()
can accept objects if they pass an is_a() check, depending on the class /
object structure we agree on in the future.
There remains a few `@todo` markers you can see in the diff which need to
be thought about.
And there also remains the decisions on exactly how to utilize the
`schema` property and what [https://make.wordpress.org/core/2016/05/03/a
-data-schema-for-meta/ Data Schema] to use. There will be further
discussion about this in today's weekly dev chat meeting.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35658#comment:39>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list