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 (#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 Nov 4, 2024
1 parent 48341a1 commit 4e6bd4d
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

1 comment on commit 4e6bd4d

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 4e6bd4d.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11657013100
📝 Reported issues:

Please sign in to comment.