REST API: Fix _fields filtering of registered rest fields.

Use rest_is_field_included when determining which additional fields to include to permit filtering by nested field properties.

Backportting r47511 to the 5.4 branch.

Props Dudo, kadamwhite, TimothyBlynJacobs.
Fixes #49648.

Built from https://develop.svn.wordpress.org/branches/5.4@47563


git-svn-id: http://core.svn.wordpress.org/branches/5.4@47338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2020-04-09 22:54:07 +00:00
parent 3b39d1e4a0
commit f4270351c3
2 changed files with 2 additions and 2 deletions

View File

@ -451,7 +451,7 @@ abstract class WP_REST_Controller {
continue;
}
if ( ! in_array( $field_name, $requested_fields, true ) ) {
if ( ! rest_is_field_included( $field_name, $requested_fields ) ) {
continue;
}

View File

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