diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index c4727ea3ba8a0..5dbb9f33e4970 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -51,6 +51,8 @@ static function ( $classes ) { $rest_path = rest_get_route_for_post( $post ); +$active_theme = get_stylesheet(); + // Preload common data. $preload_paths = array( '/wp/v2/types?context=view', @@ -65,8 +67,10 @@ static function ( $classes ) { sprintf( '%s/autosaves?context=edit', $rest_path ), '/wp/v2/settings', array( '/wp/v2/settings', 'OPTIONS' ), - '/wp/v2/global-styles/themes/' . get_stylesheet(), + '/wp/v2/global-styles/themes/' . $active_theme . '?context=view', + '/wp/v2/global-styles/themes/' . $active_theme . '/variations?context=view', '/wp/v2/themes?context=edit&status=active', + array( '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id(), 'OPTIONS' ), '/wp/v2/global-styles/' . WP_Theme_JSON_Resolver::get_user_global_styles_post_id() . '?context=edit', ); diff --git a/src/wp-admin/site-editor.php b/src/wp-admin/site-editor.php index a678fc1e44ab3..3207bccdf2632 100644 --- a/src/wp-admin/site-editor.php +++ b/src/wp-admin/site-editor.php @@ -97,8 +97,9 @@ static function ( $classes ) { '/wp/v2/template-parts?context=edit&per_page=-1', '/wp/v2/themes?context=edit&status=active', '/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit', - '/wp/v2/global-styles/' . $active_global_styles_id, - '/wp/v2/global-styles/themes/' . $active_theme, + array( '/wp/v2/global-styles/' . $active_global_styles_id, 'OPTIONS' ), + '/wp/v2/global-styles/themes/' . $active_theme . '?context=view', + '/wp/v2/global-styles/themes/' . $active_theme . '/variations?context=view', array( $navigation_rest_route, 'OPTIONS' ), array( add_query_arg(