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.

Props Dudo, kadamwhite, TimothyBlynJacobs.
Fixes #49648.

Built from https://develop.svn.wordpress.org/trunk@47511


git-svn-id: http://core.svn.wordpress.org/trunk@47286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
K. Adam White 2020-03-26 17:52:16 +00:00
parent 7dbad241cb
commit 58d5aad2a3
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.5-alpha-47510';
$wp_version = '5.5-alpha-47511';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.