Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme JSON: Update core theme json resolver class use to Gutenberg version #63981

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading