REST API: Don't add fields to object when not included in ?_fields=.

In [43087], we improved REST API performance by only rendering the fields specified in the request. Similarly, any fields registered with `register_rest_field()` should only be rendered when included in `?_fields=`.

Props dlh, danielbachhuber.

Merges [43736] to trunk.

Fixes #45099.
Built from https://develop.svn.wordpress.org/trunk@43986


git-svn-id: http://core.svn.wordpress.org/trunk@43818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj
2018-12-12 20:51:25 +00:00
parent c108cbfa52
commit a5b0312f1e
2 changed files with 7 additions and 1 deletions

View File

@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-alpha-43985';
$wp_version = '5.1-alpha-43986';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.