Skip to content

Commit

Permalink
Theme JSON Resolver: remove theme json merge in resolve_theme_file_ur…
Browse files Browse the repository at this point in the history
…is (WordPress#66662)

Removes unnecessary merge. We're only setting values for paths. Add a Backport log.

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: andrewserong <[email protected]>
  • Loading branch information
4 people authored and karthick-murugan committed Nov 13, 2024
1 parent cf48486 commit 3bd2b13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions backport-changelog/6.8/7698.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7698

* https://github.com/WordPress/gutenberg/pull/66662
8 changes: 2 additions & 6 deletions lib/class-wp-theme-json-resolver-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -920,18 +920,14 @@ public static function resolve_theme_file_uris( $theme_json ) {
return $theme_json;
}

$resolved_theme_json_data = array(
'version' => WP_Theme_JSON_Gutenberg::LATEST_SCHEMA,
);
$resolved_theme_json_data = $theme_json->get_raw_data();

foreach ( $resolved_urls as $resolved_url ) {
$path = explode( '.', $resolved_url['target'] );
_wp_array_set( $resolved_theme_json_data, $path, $resolved_url['href'] );
}

$theme_json->merge( new WP_Theme_JSON_Gutenberg( $resolved_theme_json_data ) );

return $theme_json;
return new WP_Theme_JSON_Gutenberg( $resolved_theme_json_data );
}

/**
Expand Down

0 comments on commit 3bd2b13

Please sign in to comment.