WP REST API: Version 2.0 Beta 12
Here are some
highlights from the changelog:
- Removes meta endpoints from primary plugin. If your project depends on post meta endpoints, please install WP REST API Meta Endpoints. For the gory history of meta, read #1425 and linked issues. At this time, we recommend using
register_rest_field()to expose meta (docs).
- Returns original resource when deleting PTCU. Now that all resources require the
forceparam, we don’t need to wrap delete responses with the
rolein the Users controller. Building the REST API gives us the opportunity to standardize on
roles, instead of having both
- Moves to consistent use of
contextthroughout controllers. Contexts limit the data present in the response. Here’s how to think of them:
embedcorrelates with sidebar representation,
viewrepresents the primary public view, and
editis the data expected for an editor.
post_*query param support for
GET /wp/v2/comments. The proper pattern is to use
GET /wp/v2/poststo fetch the post IDs to limit the request to.
rest_sanitize_request_arg(). Dedicated functions means we can use them for validating / sanitizing query args too. Removes
What’s the future of the WP REST API? I’d like to leave you with this final thought:
What came first, the chicken or the egg?
I egged the chicken, and then I ate his leg