23 thoughts on “Custom post type and metadata support in the REST API

  1. Reblogged this on Joey Kudish and commented:

    An internal tool that I’m building at Automattic is using the WordPress.com REST API. As part of that tool, I needed access to custom post types and post metadata, so I’ve added both to our REST API. And now anyone on a Jetpack-powered site can also use this part of the REST API. Find out the details in this developer blog post.

  2. I hope that you will add support for Custom post types for Publicize, Photon and other modules… JetPack is huge help, but for CMS use of WP not so much… Enchanted support for Custom post types in JetPack would be dream come true for me and many other developers / users. .

  3. I really like these latest enhancements :)

    One major thing I’d really like to see though, as a plugin developer super eager to start doing some cool things here:

    meta_query / tax_query support in get posts (single site / multiple sites)

    Please keep that in mind for the future, so much that we can do once we’ve got that, would save a lot of manual iteration through PHP arrays to filter down.

    1. I agree it would be cool to see meta_query / tax_query in the API. No plans for it as of now as far as I know, though we do support basic meta_key, meta_value and tags and categories queries.

  4. Also, it wasn’t immediate apparent, but in the get post data, does it return data unserialized or do serialized arrays remain serialized?

    And in add/update post data, assuming it accepts arrays/objects and will serialize accordingly?

  5. Is there a filter to add meta keys to a blacklist? Say you have meta that is intended to be edited only by users with ‘unfiltered_html’ capabilities, not ‘edit_meta_data’. Anyway to disable or modify the api exposure?

    1. Hi Ken,

      Sorry for the delayed response. At this time, it’s not possible to blacklist an API key. Can you please share a bit more details about what you’re doing and we might be able to help out better?

      1. I see now that the edit_meta_data capability isn’t assigned to any users unless explicitly assigned to the key. I misunderstood its implementation. I was worried that a key would be exposed unintentionally. Thanks!

  6. Hi I tried to access my api unauthenticated and all I got in the metadata array is [false], according to this article, I can access my post metadata without authentication, any idea? Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s