Skip to content

Commit

Permalink
Theme JSON: Update core theme json resolver class use to Gutenberg ve…
Browse files Browse the repository at this point in the history
…rsion (#63981)

* Theme JSON: Update core class use to Gutenberg version

* Address nit


Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: mukeshpanchal27 <[email protected]>
Co-authored-by: mikachan <[email protected]>
Co-authored-by: andrewserong <[email protected]>
  • Loading branch information
5 people authored Aug 2, 2024
1 parent c6d7b2f commit a528233
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/compat/wordpress-6.6/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function wp_api_template_access_controller( $args, $post_type ) {
/**
* Adds the post classes to the REST API response.
*
* @param array $post The response object data.
* @param array $post The response object data.
*
* @return array
*/
Expand Down Expand Up @@ -169,7 +169,7 @@ function gutenberg_block_editor_preload_paths_6_6( $paths, $context ) {
if ( 'core/edit-post' === $context->name ) {
$paths[] = '/wp/v2/global-styles/themes/' . get_stylesheet();
$paths[] = '/wp/v2/themes?context=edit&status=active';
$paths[] = '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=edit';
$paths[] = '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id() . '?context=edit';
}
return $paths;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/experimental/posts/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function gutenberg_posts_dashboard() {
);

$editor_settings = get_block_editor_settings( $custom_settings, $block_editor_context );
$active_global_styles_id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id();
$active_global_styles_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
$active_theme = get_stylesheet();

$preload_paths = array(
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/plugins/delete-installed-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function gutenberg_delete_installed_fonts() {
}

// Delete any installed fonts from global styles.
$global_styles_post_id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id();
$global_styles_post_id = WP_Theme_JSON_Resolver_Gutenberg::get_user_global_styles_post_id();
$request = new WP_REST_Request( 'POST', '/wp/v2/global-styles/' . $global_styles_post_id );
$request->set_body_params( array( 'settings' => array( 'typography' => array( 'fontFamilies' => array() ) ) ) );

Expand Down

0 comments on commit a528233

Please sign in to comment.