From 58d5aad2a3cccce7f0695a4686c719a22e5b5adc Mon Sep 17 00:00:00 2001 From: "K. Adam White" Date: Thu, 26 Mar 2020 17:52:16 +0000 Subject: [PATCH] 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 --- wp-includes/rest-api/endpoints/class-wp-rest-controller.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index d9d60d2ee9..b9c05eb894 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 7bc6ddb21a..0bfd0c5cc2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.