From 9a0d27e967e1847d1b657ce4faab185ed758899a Mon Sep 17 00:00:00 2001 From: Ramon Date: Fri, 1 Nov 2024 15:47:31 +1100 Subject: [PATCH] Theme JSON: replace top-level background style objects on merge (#66656) This commit fixes an omission in the theme json merge logic where top-level background image objects are not replaced, rather they are merged, which was the state of affairs before https://github.com/WordPress/gutenberg/pull/64128 Co-authored-by: ramonjd Co-authored-by: andrewserong Source: https://github.com/WordPress/gutenberg/commit/11e2d06d86349b3cf4db40ec88988d66647f543a --- gutenberg.php | 2 +- lib/class-wp-theme-json-gutenberg.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gutenberg.php b/gutenberg.php index 62342b124..842aa8d9b 100644 --- a/gutenberg.php +++ b/gutenberg.php @@ -14,7 +14,7 @@ ### BEGIN AUTO-GENERATED DEFINES define( 'GUTENBERG_VERSION', '19.6.0' ); -define( 'GUTENBERG_GIT_COMMIT', '99d22755b4e92b5bc09856b2c14a9564fb6797fc' ); +define( 'GUTENBERG_GIT_COMMIT', '11e2d06d86349b3cf4db40ec88988d66647f543a' ); ### END AUTO-GENERATED DEFINES defined( 'GUTENBERG_MINIMUM_WP_VERSION' ) or define( 'GUTENBERG_MINIMUM_WP_VERSION', '6.5' ); diff --git a/lib/class-wp-theme-json-gutenberg.php b/lib/class-wp-theme-json-gutenberg.php index 09f388e7d..dafa8b25f 100644 --- a/lib/class-wp-theme-json-gutenberg.php +++ b/lib/class-wp-theme-json-gutenberg.php @@ -3297,6 +3297,10 @@ public function merge( $incoming ) { array(), array( 'include_node_paths_only' => true ) ); + + // Add top-level styles. + $style_nodes[] = array( 'path' => array( 'styles' ) ); + foreach ( $style_nodes as $style_node ) { $path = $style_node['path']; /*