Skip to content

Commit

Permalink
Theme JSON: get_block_nodes - relocate $selectors assignment (#66265)
Browse files Browse the repository at this point in the history
Backport from WordPress/wordpress-develop#7575

Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>

Source: WordPress/gutenberg@0b972a8
  • Loading branch information
ramonjd committed Oct 21, 2024
1 parent 72733e7 commit dc2b5e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

### BEGIN AUTO-GENERATED DEFINES
define( 'GUTENBERG_VERSION', '19.5.0' );
define( 'GUTENBERG_GIT_COMMIT', 'b4443e43b267d9361e1fbd762f602ce490a923ac' );
define( 'GUTENBERG_GIT_COMMIT', '0b972a8db2d75236c7d0310625aaa1cd1ece7e91' );
### END AUTO-GENERATED DEFINES
defined( 'GUTENBERG_MINIMUM_WP_VERSION' ) or define( 'GUTENBERG_MINIMUM_WP_VERSION', '6.5' );

Expand Down
6 changes: 5 additions & 1 deletion lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -2738,10 +2738,14 @@ private static function get_block_nodes( $theme_json, $selectors = array(), $opt
return $nodes;
}

$selectors = empty( $selectors ) ? static::get_blocks_metadata() : $selectors;
$include_variations = $options['include_block_style_variations'] ?? false;
$include_node_paths_only = $options['include_node_paths_only'] ?? false;

// If only node paths are to be returned, skip selector assignment.
if ( ! $include_node_paths_only ) {
$selectors = empty( $selectors ) ? static::get_blocks_metadata() : $selectors;
}

foreach ( $theme_json['styles']['blocks'] as $name => $node ) {
$node_path = array( 'styles', 'blocks', $name );
if ( $include_node_paths_only ) {
Expand Down

0 comments on commit dc2b5e9

Please sign in to comment.