From 0eb736b01172554e5a7ea1efe371eddd7be9589f Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Thu, 10 Oct 2024 13:56:04 -0700 Subject: [PATCH] Move option variable assignments before the loops. --- src/wp-includes/class-wp-theme-json.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/class-wp-theme-json.php b/src/wp-includes/class-wp-theme-json.php index f6ba9f5d09de6..8603a4cbbd169 100644 --- a/src/wp-includes/class-wp-theme-json.php +++ b/src/wp-includes/class-wp-theme-json.php @@ -2714,9 +2714,10 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt return $nodes; } - foreach ( $theme_json['styles']['blocks'] as $name => $node ) { + $include_variations = $options['include_block_style_variations'] ?? false; + $include_node_paths_only = $options['include_node_paths_only'] ?? false; - $include_node_paths_only = $options['include_node_paths_only'] ?? false; + foreach ( $theme_json['styles']['blocks'] as $name => $node ) { $node_path = array( 'styles', 'blocks', $name ); if ( $include_node_paths_only ) { $nodes[] = array( @@ -2739,7 +2740,6 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt } $variation_selectors = array(); - $include_variations = $options['include_block_style_variations'] ?? false; if ( $include_variations && isset( $node['variations'] ) ) { foreach ( $node['variations'] as $variation => $node ) { $variation_selectors[] = array(