Block Editor: Fix for theme.json: color.duotone and spacing.units should allow empty sets.

This commit fixes an issue with the color.duotone & spacing.units in which empty values didn't override previous origins, resulting in that a theme couldn't provide an empty set for this via its theme.json.

Props nosolosw, youknowriad, aristath.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51383


git-svn-id: http://core.svn.wordpress.org/trunk@50994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
jorgefilipecosta 2021-07-08 19:31:57 +00:00
parent 2d18007ac5
commit d05e5232b7
2 changed files with 3 additions and 3 deletions

View File

@ -1106,8 +1106,8 @@ class WP_Theme_JSON {
foreach ( $nodes as $metadata ) {
foreach ( $to_replace as $property_path ) {
$path = array_merge( $metadata['path'], $property_path );
$node = _wp_array_get( $incoming_data, $path, array() );
if ( ! empty( $node ) ) {
$node = _wp_array_get( $incoming_data, $path, null );
if ( isset( $node ) ) {
_wp_array_set( $this->theme_json, $path, $node );
}
}

View File

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