diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php index 886b97e14c..c5d4e89e5e 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php @@ -312,6 +312,15 @@ class WP_REST_Global_Styles_Revisions_Controller extends WP_REST_Revisions_Contr $theme_json = null; if ( ! empty( $global_styles_config['styles'] ) || ! empty( $global_styles_config['settings'] ) ) { + /* + * Register block style variations from the theme data. + * This is required so the variations pass sanitization of theme.json data. + */ + if ( ! empty( $global_styles_config['styles']['blocks'] ) ) { + $variations = WP_Theme_JSON_Resolver::get_style_variations( 'block' ); + wp_register_block_style_variations_from_theme_json_partials( $variations ); + } + $theme_json = new WP_Theme_JSON( $global_styles_config, 'custom' ); $global_styles_config = $theme_json->get_raw_data(); if ( rest_is_field_included( 'settings', $fields ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 282f058298..7e669e1f9f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.0-alpha-61300'; +$wp_version = '7.0-alpha-61301'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.