Version 2.0 Beta 2: You Finally Made a Monkey Out of Me
Pre-release-
Load the WP REST API before the main query runs.
The
rest_api_loadedfunction now hooks into theparse_requestaction.
This change prevents the main query from being run on every request and
allows sites to setWP_USE_THEMEStofalse. 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.(props @joehoyle, @rachelbaker, #927)
(props @joehoyle, #1207)
(props @joehoyle, #1243) -
Add endpoints for viewing, creating, updating, and deleting Terms for a Post.
The new
WP_REST_Posts_Terms_Controllerclass controller supports routes for
Terms that belong to a Post.(props @joehoyle, @danielbachhuber, #1216)
-
Add pagination headers for collection queries.
The
X-WP-TotalandX-WP-TotalPagesare now present in terms, comments,
and users collection responses.(props @danielbachhuber, #1182)
(props @danielbachhuber, #1191)
(props @danielbachhuber, @joehoyle, #1197) -
List registered namespaces in the index for feature detection.
The index (
/wp-jsonby default) now contains a list of the available
namespaces. This allows for simple feature detection. You can grab the index
and check namespaces forwp/v3orpluginname/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.(props @rmccue, @rachelbaker, #1284)
-
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 a random message when deleting a Post, Comment, Term, or
User provide the original resource data.(props @danielbachhuber, #1253)
(props @danielbachhuber, #1254)
(props @danielbachhuber, #1255)
(props @danielbachhuber, #1256) -
Return programmatically readable error messages for invalid or missing
required parameters. -
Declare supported arguments for Comment and User collection queries.
(props @danielbachhuber, #1211)
(props @danielbachhuber, #1217) -
Automatically validate parameters based on Schema data.
-
Use the
show_in_restattributes for exposing Taxonomies. -
Handle
parentwhen creating or updating a Term. -
Limit fields returned in
embedcontext User responses.(props @rachelbaker, #1251)
-
Only include
parentin term response when tax is hierarchical.(props @danielbachhuber, #1189)
-
Fix bug in creating comments if
typewas not set.(props @rachelbaker, #1244)
-
Rename
post_namefield topost_slug.(props @danielbachhuber, #1235)
-
Add check when creating a user to verify the provided role is valid.
(props @rachelbaker, #1267)
-
Add link properties to the Post Status response.
-
Return
0forparentin Post response instead ofnull.(props @danielbachhuber, #1269)
-
Only link
authorwhen there's a valid author(props @danielbachhuber, #1203)
-
Only permit querying by parent term when tax is hierarchical.
(props @danielbachhuber, #1219)
-
Only permit deleting posts of the proper type
(props @danielbachhuber, #1257)
-
Set pagination headers even when no found posts.
(props @danielbachhuber, #1209)
-
Correct prefix in
rest_request_parameter_orderfilter. -
Retool
WP_REST_Terms_Controllerto follow Posts controller pattern.(props @danielbachhuber, #1170)
-
Remove unused
accept_json argumentfrom theregister_routesmethod. -
Fix typo in
sanitize_paramsinline documentation. -
Remove commented out code in dispatch method.
(props @rachelbaker, #1162)