Skip to content

Commit 251e889

Browse files
committed
Move assignments up outside main loop
1 parent 2531554 commit 251e889

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/class-wp-theme-json-gutenberg.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,9 +2743,11 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
27432743
return $nodes;
27442744
}
27452745

2746+
$include_variations = $options['include_block_style_variations'] ?? false;
2747+
$include_node_paths_only = $options['include_node_paths_only'] ?? false;
2748+
27462749
foreach ( $theme_json['styles']['blocks'] as $name => $node ) {
2747-
$include_node_paths_only = $options['include_node_paths_only'] ?? false;
2748-
$node_path = array( 'styles', 'blocks', $name );
2750+
$node_path = array( 'styles', 'blocks', $name );
27492751
if ( $include_node_paths_only ) {
27502752
$nodes[] = array(
27512753
'path' => $node_path,
@@ -2767,7 +2769,7 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
27672769
}
27682770

27692771
$variation_selectors = array();
2770-
$include_variations = $options['include_block_style_variations'] ?? false;
2772+
27712773
if ( $include_variations && isset( $node['variations'] ) ) {
27722774
foreach ( $node['variations'] as $variation => $node ) {
27732775
$variation_selectors[] = array(

0 commit comments

Comments
 (0)