From cdba16a8a62c096c305813adc5d79ee8a0ae36ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Fri, 7 Jun 2024 17:50:14 +0200 Subject: [PATCH 01/12] Register block style variations defined by the theme on init --- .../block-supports/block-style-variations.php | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index c8ba6e75aaa80..9db733531ea17 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -422,3 +422,83 @@ function wp_enqueue_block_style_variation_styles() { add_filter( 'wp_theme_json_data_theme', 'wp_resolve_block_style_variations_from_styles_registry', 10, 1 ); add_filter( 'wp_theme_json_data_user', 'wp_resolve_block_style_variations_from_theme_style_variation', 10, 1 ); + +/** + * @access private + */ +function wp_register_block_style_variations_from_theme_json_data( $variations ) { + $variations_data = array(); + + if ( empty( $variations ) ) { + return $variations_data; + } + + $registry = WP_Block_Styles_Registry::get_instance(); + $have_named_variations = ! wp_is_numeric_array( $variations ); + + foreach ( $variations as $key => $variation ) { + $supported_blocks = $variation['blockTypes'] ?? array(); + + /* + * Standalone theme.json partial files for block style variations + * will have their styles under a top-level property by the same name. + * Variations defined within an existing theme.json or theme style + * variation will themselves already be the required styles data. + */ + $variation_data = $variation['styles'] ?? $variation; + + if ( empty( $variation_data ) ) { + continue; + } + + /* + * Block style variations read in via standalone theme.json partials + * need to have their name set to the kebab case version of their title. + */ + $variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] ); + $variation_label = $variation['title'] ?? $variation_name; + + foreach ( $supported_blocks as $block_type ) { + $registered_styles = $registry->get_registered_styles_for_block( $block_type ); + + // Register block style variation if it hasn't already been registered. + if ( ! array_key_exists( $variation_name, $registered_styles ) ) { + register_block_style( + $block_type, + array( + 'name' => $variation_name, + 'label' => $variation_label, + ) + ); + } + } + } +} + +/** + * @access private + * + * Register the block style variations defined by the theme. + * These can come in three forms: + * + * - the theme's theme.json + * - the theme's partials (standalone files in styles that only define block style variations) + * - the user's theme.json (for example, theme style variations the user selected) + * + */ +function wp_register_block_style_variations_from_theme() { + // Partials. + $variations_partials = WP_Theme_JSON_Resolver::get_style_variations( 'block' ); + wp_register_block_style_variations_from_theme_json_data( $variations_partials ); + + // theme.json of the theme. + $theme_json_theme = WP_Theme_JSON_Resolver::get_theme_data(); + $variations_theme = $theme_json_theme->get_data()['styles']['blocks']['variations'] ?? array(); + wp_register_block_style_variations_from_theme_json_data( $variations_theme ); + + // User data linked for this theme. + $theme_json_user = WP_Theme_JSON_Resolver::get_user_data(); + $variations_user = $theme_json_user->get_data()['styles']['blocks']['variations'] ?? array(); + wp_register_block_style_variations_from_theme_json_data( $variations_user ); +} +add_filter( 'init', 'wp_register_block_style_variations_from_theme' ); From ff580e07399b00e610dbdadfcca7fe8f130a6ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Fri, 7 Jun 2024 17:50:29 +0200 Subject: [PATCH 02/12] Remove registration from wp_theme_json_data_* filters --- .../block-supports/block-style-variations.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index 9db733531ea17..f2aeef7cd5446 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -231,7 +231,6 @@ function wp_resolve_and_register_block_style_variations( $variations ) { return $variations_data; } - $registry = WP_Block_Styles_Registry::get_instance(); $have_named_variations = ! wp_is_numeric_array( $variations ); foreach ( $variations as $key => $variation ) { @@ -254,22 +253,8 @@ function wp_resolve_and_register_block_style_variations( $variations ) { * need to have their name set to the kebab case version of their title. */ $variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] ); - $variation_label = $variation['title'] ?? $variation_name; foreach ( $supported_blocks as $block_type ) { - $registered_styles = $registry->get_registered_styles_for_block( $block_type ); - - // Register block style variation if it hasn't already been registered. - if ( ! array_key_exists( $variation_name, $registered_styles ) ) { - register_block_style( - $block_type, - array( - 'name' => $variation_name, - 'label' => $variation_label, - ) - ); - } - // Add block style variation data under current block type. $path = array( $block_type, 'variations', $variation_name ); _wp_array_set( $variations_data, $path, $variation_data ); From f574d7dedb073554d243923a9c6274e49ea7eecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Mon, 10 Jun 2024 18:35:44 +0200 Subject: [PATCH 03/12] Add comment --- .../block-supports/block-style-variations.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index f2aeef7cd5446..21bc82c1ee7fd 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -476,6 +476,16 @@ function wp_register_block_style_variations_from_theme() { $variations_partials = WP_Theme_JSON_Resolver::get_style_variations( 'block' ); wp_register_block_style_variations_from_theme_json_data( $variations_partials ); + /* + * Pull the data from the specific origin instead of the merged data. + * This is because, for 6.6, we only support registering block style variations + * for the 'theme' and 'custom' origins but not for 'default' (core theme.json) + * or 'custom' (theme.json in a block). + * + * When/If we add support for every origin, we should switch to using the public API + * instead, e.g.: wp_get_global_styles( array( 'blocks', 'variations' ) ). + */ + // theme.json of the theme. $theme_json_theme = WP_Theme_JSON_Resolver::get_theme_data(); $variations_theme = $theme_json_theme->get_data()['styles']['blocks']['variations'] ?? array(); From 522b51de58a3f3140e832f831e3cf7603d339654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Mon, 10 Jun 2024 18:40:23 +0200 Subject: [PATCH 04/12] Rename for clarity --- src/wp-includes/block-supports/block-style-variations.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index 21bc82c1ee7fd..0f463fc100927 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -224,7 +224,7 @@ function wp_render_block_style_variation_class_name( $block_content, $block ) { * * @return array Block variations data to be merged under `styles.blocks`. */ -function wp_resolve_and_register_block_style_variations( $variations ) { +function wp_resolve_block_style_variations( $variations ) { $variations_data = array(); if ( empty( $variations ) ) { @@ -312,7 +312,7 @@ function wp_merge_block_style_variations_data( $variations_data, $theme_json, $o function wp_resolve_block_style_variations_from_theme_style_variation( $theme_json ) { $theme_json_data = $theme_json->get_data(); $shared_variations = $theme_json_data['styles']['blocks']['variations'] ?? array(); - $variations_data = wp_resolve_and_register_block_style_variations( $shared_variations ); + $variations_data = wp_resolve_block_style_variations( $shared_variations ); return wp_merge_block_style_variations_data( $variations_data, $theme_json, 'user' ); } @@ -330,7 +330,7 @@ function wp_resolve_block_style_variations_from_theme_style_variation( $theme_js */ function wp_resolve_block_style_variations_from_theme_json_partials( $theme_json ) { $block_style_variations = WP_Theme_JSON_Resolver::get_style_variations( 'block' ); - $variations_data = wp_resolve_and_register_block_style_variations( $block_style_variations ); + $variations_data = wp_resolve_block_style_variations( $block_style_variations ); return wp_merge_block_style_variations_data( $variations_data, $theme_json ); } @@ -349,7 +349,7 @@ function wp_resolve_block_style_variations_from_theme_json_partials( $theme_json function wp_resolve_block_style_variations_from_primary_theme_json( $theme_json ) { $theme_json_data = $theme_json->get_data(); $block_style_variations = $theme_json_data['styles']['blocks']['variations'] ?? array(); - $variations_data = wp_resolve_and_register_block_style_variations( $block_style_variations ); + $variations_data = wp_resolve_block_style_variations( $block_style_variations ); return wp_merge_block_style_variations_data( $variations_data, $theme_json ); } From bfcf9f27bf0b1c5a0f7d7e4b928843ab02e0d523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Tue, 11 Jun 2024 08:08:22 +0200 Subject: [PATCH 05/12] Update wp_register_block_style_variations_from_theme --- .../block-supports/block-style-variations.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index 0f463fc100927..39d83c36b3df2 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -461,18 +461,17 @@ function wp_register_block_style_variations_from_theme_json_data( $variations ) } /** - * @access private + * Register shared block style variations defined by the theme. * - * Register the block style variations defined by the theme. * These can come in three forms: - * * - the theme's theme.json - * - the theme's partials (standalone files in styles that only define block style variations) + * - the theme's partials (standalone files in `/styles` that only define block style variations) * - the user's theme.json (for example, theme style variations the user selected) * + * @access private */ function wp_register_block_style_variations_from_theme() { - // Partials. + // Partials from `/styles`. $variations_partials = WP_Theme_JSON_Resolver::get_style_variations( 'block' ); wp_register_block_style_variations_from_theme_json_data( $variations_partials ); @@ -496,4 +495,4 @@ function wp_register_block_style_variations_from_theme() { $variations_user = $theme_json_user->get_data()['styles']['blocks']['variations'] ?? array(); wp_register_block_style_variations_from_theme_json_data( $variations_user ); } -add_filter( 'init', 'wp_register_block_style_variations_from_theme' ); +add_action( 'init', 'wp_register_block_style_variations_from_theme' ); From f29b5cceb5ad02a09505a6ba71100f18e6bb0c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Tue, 11 Jun 2024 08:10:42 +0200 Subject: [PATCH 06/12] Remove docblock --- src/wp-includes/block-supports/block-style-variations.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index 39d83c36b3df2..33c2b1e349f6d 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -213,9 +213,6 @@ function wp_render_block_style_variation_class_name( $block_content, $block ) { /** * Collects block style variation data for merging with theme.json data. - * As each block style variation is processed it is registered if it hasn't - * been already. This registration is required for later sanitization of - * theme.json data. * * @since 6.6.0 * @access private From 86f522746dc6c58bc995c378d18471675147c593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Tue, 11 Jun 2024 08:12:36 +0200 Subject: [PATCH 07/12] Update wp_register_block_style_variations_from_theme_json_data --- .../block-supports/block-style-variations.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index 33c2b1e349f6d..8312f5edcfa6a 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -406,13 +406,16 @@ function wp_enqueue_block_style_variation_styles() { add_filter( 'wp_theme_json_data_user', 'wp_resolve_block_style_variations_from_theme_style_variation', 10, 1 ); /** + * Registers any block style variations contained within the provided + * theme.json data. + * * @access private + * + * @param array $variations Shared block style variations. */ function wp_register_block_style_variations_from_theme_json_data( $variations ) { - $variations_data = array(); - if ( empty( $variations ) ) { - return $variations_data; + return $variations; } $registry = WP_Block_Styles_Registry::get_instance(); From 8c53d8dfdd6ad26013e2c331b9e4c72780662fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Tue, 11 Jun 2024 08:15:56 +0200 Subject: [PATCH 08/12] Update test_add_registered_block_styles_to_theme_data to register variations --- .../phpunit/tests/block-supports/block-style-variations.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/phpunit/tests/block-supports/block-style-variations.php b/tests/phpunit/tests/block-supports/block-style-variations.php index 467144ffdc781..987959e3cbcce 100644 --- a/tests/phpunit/tests/block-supports/block-style-variations.php +++ b/tests/phpunit/tests/block-supports/block-style-variations.php @@ -65,6 +65,11 @@ public function filter_set_theme_root() { public function test_add_registered_block_styles_to_theme_data() { switch_theme( 'block-theme' ); + // Trigger block style registration that occurs on `init` action. + // do_action( 'init' ) could be used here however this direct call + // means only the updates being tested are performed. + wp_register_block_style_variations_from_theme(); + $variation_styles_data = array( 'color' => array( 'background' => 'darkslateblue', From d51c763edcb9899e6d51e2134aa13a0c1d32e70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Tue, 11 Jun 2024 22:18:45 +0200 Subject: [PATCH 09/12] Register teh newly created style variations. --- .../class-wp-rest-global-styles-controller.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index 3b2caf88fe65b..24c8123b2a5a7 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -263,6 +263,23 @@ protected function prepare_item_for_database( $request ) { } elseif ( isset( $existing_config['styles'] ) ) { $config['styles'] = $existing_config['styles']; } + + // If the incoming request is going to create a new variation + // that is not yet registered, we register it here. + // This is because the variations are registered on init, + // but we want this endpoint to return the new variation immediately: + // if we don't register it, it'll be stripped out of the response + // just in this request (subsequent ones will be ok). + // Take the variations defined in styles.blocks.variations from the incoming request + // that are not part of the $exsting_config. + if ( isset( $request['styles']['blocks']['variations'] ) ) { + $existing_variations = isset( $existing_config['styles']['blocks']['variations'] ) ? $existing_config['styles']['blocks']['variations'] : array(); + $new_variations = array_diff_key( $request['styles']['blocks']['variations'], $existing_variations ); + if ( ! empty( $new_variations ) ) { + wp_register_block_style_variations_from_theme_json_data( $new_variations ); + } + } + if ( isset( $request['settings'] ) ) { $config['settings'] = $request['settings']; } elseif ( isset( $existing_config['settings'] ) ) { From 10a638a57c91e0ed1ad3c965c44eced4acbf8b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Wed, 12 Jun 2024 08:36:50 +0200 Subject: [PATCH 10/12] Address feedback --- .../block-supports/block-style-variations.php | 4 +++- ...class-wp-rest-global-styles-controller.php | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/block-supports/block-style-variations.php b/src/wp-includes/block-supports/block-style-variations.php index 8312f5edcfa6a..a44ecdd396e18 100644 --- a/src/wp-includes/block-supports/block-style-variations.php +++ b/src/wp-includes/block-supports/block-style-variations.php @@ -249,7 +249,7 @@ function wp_resolve_block_style_variations( $variations ) { * Block style variations read in via standalone theme.json partials * need to have their name set to the kebab case version of their title. */ - $variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] ); + $variation_name = $have_named_variations ? $key : _wp_to_kebab_case( $variation['title'] ); foreach ( $supported_blocks as $block_type ) { // Add block style variation data under current block type. @@ -409,6 +409,7 @@ function wp_enqueue_block_style_variation_styles() { * Registers any block style variations contained within the provided * theme.json data. * + * @since 6.6.0 * @access private * * @param array $variations Shared block style variations. @@ -468,6 +469,7 @@ function wp_register_block_style_variations_from_theme_json_data( $variations ) * - the theme's partials (standalone files in `/styles` that only define block style variations) * - the user's theme.json (for example, theme style variations the user selected) * + * @since 6.6.0 * @access private */ function wp_register_block_style_variations_from_theme() { diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index 24c8123b2a5a7..8ce522c1490e2 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -231,6 +231,7 @@ public function update_item_permissions_check( $request ) { * * @since 5.9.0 * @since 6.2.0 Added validation of styles.css property. + * @since 6.6.0 Added registration of newly created style variations provided by the user. * * @param WP_REST_Request $request Request object. * @return stdClass|WP_Error Prepared item on success. WP_Error on when the custom CSS is not valid. @@ -264,14 +265,16 @@ protected function prepare_item_for_database( $request ) { $config['styles'] = $existing_config['styles']; } - // If the incoming request is going to create a new variation - // that is not yet registered, we register it here. - // This is because the variations are registered on init, - // but we want this endpoint to return the new variation immediately: - // if we don't register it, it'll be stripped out of the response - // just in this request (subsequent ones will be ok). - // Take the variations defined in styles.blocks.variations from the incoming request - // that are not part of the $exsting_config. + /* + * If the incoming request is going to create a new variation + * that is not yet registered, we register it here. + * This is because the variations are registered on init, + * but we want this endpoint to return the new variation immediately: + * if we don't register it, it'll be stripped out of the response + * just in this request (subsequent ones will be ok). + * Take the variations defined in styles.blocks.variations from the incoming request + * that are not part of the $exsting_config. + */ if ( isset( $request['styles']['blocks']['variations'] ) ) { $existing_variations = isset( $existing_config['styles']['blocks']['variations'] ) ? $existing_config['styles']['blocks']['variations'] : array(); $new_variations = array_diff_key( $request['styles']['blocks']['variations'], $existing_variations ); From a40bb88f020e07b3f862755607aba25f055a3e3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Wed, 12 Jun 2024 08:41:46 +0200 Subject: [PATCH 11/12] Test newly created variations are returned by the endpoint --- .../rest-global-styles-controller.php | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/tests/phpunit/tests/rest-api/rest-global-styles-controller.php b/tests/phpunit/tests/rest-api/rest-global-styles-controller.php index 02d3ec8d5a72c..8e80aa2dfaf33 100644 --- a/tests/phpunit/tests/rest-api/rest-global-styles-controller.php +++ b/tests/phpunit/tests/rest-api/rest-global-styles-controller.php @@ -602,6 +602,55 @@ public function test_update_item_invalid_styles_css() { $this->assertErrorResponse( 'rest_custom_css_illegal_markup', $response, 400 ); } + /** + * Tests the submission of a custom block style variation that was defined + * within a theme style variation and wouldn't be registered at the time + * of saving via the API. + * + * @covers WP_REST_Global_Styles_Controller_Gutenberg::update_item + * @ticket 61312 + */ + public function test_update_item_with_custom_block_style_variations() { + wp_set_current_user( self::$admin_id ); + if ( is_multisite() ) { + grant_super_admin( self::$admin_id ); + } + + $group_variations = array( + 'fromThemeStyleVariation' => array( + 'color' => array( + 'background' => '#ffffff', + 'text' => '#000000', + ), + ), + ); + + $request = new WP_REST_Request( 'PUT', '/wp/v2/global-styles/' . self::$global_styles_id ); + $request->set_body_params( + array( + 'styles' => array( + 'blocks' => array( + 'variations' => array( + 'fromThemeStyleVariation' => array( + 'blockTypes' => array( 'core/group', 'core/columns' ), + 'color' => array( + 'background' => '#000000', + 'text' => '#ffffff', + ), + ), + ), + 'core/group' => array( + 'variations' => $group_variations, + ), + ), + ), + ) + ); + $response = rest_get_server()->dispatch( $request ); + $data = $response->get_data(); + $this->assertSame( $group_variations, $data['styles']['blocks']['core/group']['variations'] ); + } + /** * @doesNotPerformAssertions */ From f6309c0e7e19b47e3d8990b1943f83f54c5b8198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Wed, 12 Jun 2024 08:51:50 +0200 Subject: [PATCH 12/12] Lint: accomodate to core standards --- .../tests/block-supports/block-style-variations.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/block-supports/block-style-variations.php b/tests/phpunit/tests/block-supports/block-style-variations.php index 987959e3cbcce..3adbaa407532e 100644 --- a/tests/phpunit/tests/block-supports/block-style-variations.php +++ b/tests/phpunit/tests/block-supports/block-style-variations.php @@ -65,9 +65,11 @@ public function filter_set_theme_root() { public function test_add_registered_block_styles_to_theme_data() { switch_theme( 'block-theme' ); - // Trigger block style registration that occurs on `init` action. - // do_action( 'init' ) could be used here however this direct call - // means only the updates being tested are performed. + /* + * Trigger block style registration that occurs on `init` action. + * do_action( 'init' ) could be used here however this direct call + * means only the updates being tested are performed. + */ wp_register_block_style_variations_from_theme(); $variation_styles_data = array(