[wp-trac] [WordPress Trac] #39803: REST API meta type not working properly for custom post types
WordPress Trac
noreply at wordpress.org
Tue Feb 7 05:52:06 UTC 2017
#39803: REST API meta type not working properly for custom post types
------------------------------------+------------------------
Reporter: chriseverson | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: REST API | Version: 4.7
Severity: normal | Resolution: duplicate
Keywords: has-patch dev-feedback | Focuses: rest-api
------------------------------------+------------------------
Comment (by chriseverson):
Replying to [comment:2 rheinardkorf]:
> In the docs (here: https://developer.wordpress.org/rest-api/extending-
the-rest-api/modifying-responses/#working-with-meta-and-register_meta) you
will see in the comments that for custom post types the $object_type has
to be "post".
Looking back through the documentation for `register_meta()`, I see that I
incorrectly passed the post type instead of the object type, this is where
I ran into issues. That said, it doesn't seem to be exactly the
functionality that I'm looking for as I'd like the meta fields to be post
type specific.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39803#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list