WP REST API: Version 2.0 Beta 2

## Metadata
- Author: [[Rachel Baker]]
- Full Title: WP REST API: Version 2.0 Beta 2
- Category: #articles
- Summary: A mere four weeks since releasing the first beta of version 2, the REST API team has returned to announce the second beta of version 2 is available. Adding more than forty enchancements and bugfixes, WP REST API: 2.
- URL: https://make.wordpress.org/core/2015/05/28/wp-rest-api-version-2-0-beta-2/
A mere four weeks since releasing the first beta of version 2, the REST API team has returned to announce the second beta of version 2 is available. Adding more than forty enchancements and bugfixes, WP REST API: 2.0 Beta 2 “*You Finally Made a Monkey Out of Me*” is available for download on [Github](https://github.com/WP-API/WP-API/releases/tag/2.0-beta2%E2%80%9D).
**Some important highlights in version 2.0 Beta 2 are:**
* Load the WP REST API before the main query runs. The `rest_api_loaded` function now hooks into the `parse_request` action. This change prevents the main query from being run on every request and allows sites to set `WP_USE_THEMES` to `false`. Previously, the main query was always being run (`SELECT * FROM wp_posts LIMIT 10`), even though the result was never used and couldn’t be cached.
* Register a new field on an existing WordPress object type. Introduces `register_api_field()` to add a field to an object and its schema. For example, adding a `seo_title` to all post objects, you provide `register_api_field` with a callback function to get the value for a post, a callback for updating the value and a schema to describe the field to API clients.
* Add endpoints for viewing, creating, updating, and deleting Terms for a Post. The new `WP_REST_Posts_Terms_Controller` class controller supports routes for
Terms that belong to a Post. You can now remove and add terms on posts (finally!)
* Add pagination headers for collection queries. The `X-WP-Total` and `X-WP-TotalPages` are now present in terms, comments, and users collection responses.
* List registered namespaces in the index for feature detection. The index (`/wp-json` by default) now contains a list of the available namespaces. This allows for simple feature detection. You can grab the index and check namespaces for `wp/v3` or `pluginname/v2`, which indicate the supported endpoints on the site.
* Standardize link property relations and support embedding for all resources. Change link properties to use IANA-registered relations. Also adds embedding support to Attachments, Comments and Terms.
* Add support for Composer dependency management. Allows you to recursively install/update the WP REST API inside of WordPress plugins or themes.
* Return full objects in the delete response. Instead of returning an inconsistent message when deleting a Post, Comment, Term, or User, the API will now return the original resource data.
(props [@danielbachhuber](https://profiles.wordpress.org/danielbachhuber/), [#1253](https://github.com/WP-API/WP-API/issues/1253))
(props [@danielbachhuber](https://profiles.wordpress.org/danielbachhuber/), [#1254](https://github.com/WP-API/WP-API/issues/1254))
(props [@danielbachhuber](https://profiles.wordpress.org/danielbachhuber/), [#1255](https://github.com/WP-API/WP-API/issues/1255))
(props [@danielbachhuber](https://profiles.wordpress.org/danielbachhuber/), [#1256](https://github.com/WP-API/WP-API/issues/1256))
[#json-api](https://make.wordpress.org/core/tag/json-api/), [#rest-api](https://make.wordpress.org/core/tag/rest-api/), WP REST API: Version 2.0 Beta 2, Rachel Baker, 01gnmcz0jwn2w51gh237zaarnt.