mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-16 19:46:21 +00:00
REST API: Fix error in _fields filtering logic where only one of several requested sibling properties would be included.
Props kadamwhite, TimothyBlynJacobs. Fixes #48266. Built from https://develop.svn.wordpress.org/trunk@46456 git-svn-id: http://core.svn.wordpress.org/trunk@46254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c6d3987b08
commit
1a8aba96e7
@ -743,8 +743,12 @@ function rest_filter_response_fields( $response, $server, $request ) {
|
||||
$parts = explode( '.', $field );
|
||||
$ref = &$fields_as_keyed;
|
||||
while ( count( $parts ) > 1 ) {
|
||||
$next = array_shift( $parts );
|
||||
$ref[ $next ] = array();
|
||||
$next = array_shift( $parts );
|
||||
if ( isset( $ref[ $next ] ) && true === $ref[ $next ] ) {
|
||||
// Skip any sub-properties if their parent prop is already marked for inclusion.
|
||||
break 2;
|
||||
}
|
||||
$ref[ $next ] = isset( $ref[ $next ] ) ? $ref[ $next ] : array();
|
||||
$ref = &$ref[ $next ];
|
||||
}
|
||||
$last = array_shift( $parts );
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.3-beta3-46455';
|
||||
$wp_version = '5.3-beta3-46456';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
x
Reference in New Issue
Block a user