Skip to content

Commit

Permalink
Move assignments up outside main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
ramonjd committed Oct 10, 2024
1 parent 2531554 commit 251e889
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -2743,9 +2743,11 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
return $nodes;
}

$include_variations = $options['include_block_style_variations'] ?? false;
$include_node_paths_only = $options['include_node_paths_only'] ?? false;

foreach ( $theme_json['styles']['blocks'] as $name => $node ) {
$include_node_paths_only = $options['include_node_paths_only'] ?? false;
$node_path = array( 'styles', 'blocks', $name );
$node_path = array( 'styles', 'blocks', $name );
if ( $include_node_paths_only ) {
$nodes[] = array(
'path' => $node_path,
Expand All @@ -2767,7 +2769,7 @@ 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 251e889

Please sign in to comment.