From 3026f3f46d1818e7fbb358aa14c5de8df440e2b0 Mon Sep 17 00:00:00 2001 From: ramonopoly Date: Fri, 1 Nov 2024 05:26:19 +0000 Subject: [PATCH] Theme JSON: replace top-level background style objects on merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes an omission in the logic of `WP_Theme_JSON::merge()` where top-level background image style objects are not replaced, rather they are merged. Because background images are self contained objects, their properties are unique and should not be merged. Blocks are already catered for via `WP_Theme_JSON::get_block_nodes()`. Follow-up to [61858]. Props ramonopoly, andrewserong. Fixes #62328. Built from https://develop.svn.wordpress.org/trunk@59335 git-svn-id: http://core.svn.wordpress.org/trunk@58721 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-theme-json.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 15357a9df3..cfca9a2242 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -3268,6 +3268,10 @@ class WP_Theme_JSON { 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']; /* diff --git a/wp-includes/version.php b/wp-includes/version.php index 7a6c08696f..82828eeb3c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59334'; +$wp_version = '6.8-alpha-59335'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.