From d05e5232b7eec058b2a7ec3bfd4c32a93cef8421 Mon Sep 17 00:00:00 2001 From: jorgefilipecosta Date: Thu, 8 Jul 2021 19:31:57 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-theme-json.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 486156fcd3..b140601a43 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -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 ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index d1c750004a..f7361c1993 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.