From 221da697151c4b0f7037f1723b181864304ea8ac Mon Sep 17 00:00:00 2001 From: Jorge Date: Mon, 14 Jun 2021 22:22:03 +0100 Subject: [PATCH] Fix: Logic on theme.json constructor. --- lib/class-wp-theme-json-gutenberg.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index d9d4f076d3df4b..7ac18b4cd2c9ee 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -306,8 +306,8 @@ public function __construct( $theme_json = array(), $origin = 'theme' ) { foreach ( $nodes as $node ) { foreach ( self::PRESETS_METADATA as $preset ) { $path = array_merge( $node['path'], $preset['path'] ); - $preset = _wp_array_get( $this->theme_json, $path, array() ); - if ( ! empty( $preset ) ) { + $preset = _wp_array_get( $this->theme_json, $path, null ); + if ( null !== $preset ) { gutenberg_experimental_set( $this->theme_json, $path, array( $origin => $preset ) ); } }