Skip to content

Commit

Permalink
Move option variable assignments before the loops.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Oct 10, 2024
1 parent 115dc4e commit 0eb736b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit 0eb736b

Please sign in to comment.