Changeset 59262
- Timestamp:
- 10/21/2024 04:46:39 AM (6 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r59253 r59262 2708 2708 */ 2709 2709 private static function get_block_nodes( $theme_json, $selectors = array(), $options = array() ) { 2710 $selectors = empty( $selectors ) ? static::get_blocks_metadata() : $selectors; 2711 $nodes = array(); 2712 if ( ! isset( $theme_json['styles'] ) ) { 2713 return $nodes; 2714 } 2715 2716 // Blocks. 2710 $nodes = array(); 2711 2717 2712 if ( ! isset( $theme_json['styles']['blocks'] ) ) { 2718 2713 return $nodes; … … 2721 2716 $include_variations = $options['include_block_style_variations'] ?? false; 2722 2717 $include_node_paths_only = $options['include_node_paths_only'] ?? false; 2718 2719 // If only node paths are to be returned, skip selector assignment. 2720 if ( ! $include_node_paths_only ) { 2721 $selectors = empty( $selectors ) ? static::get_blocks_metadata() : $selectors; 2722 } 2723 2723 2724 2724 foreach ( $theme_json['styles']['blocks'] as $name => $node ) {
Note: See TracChangeset
for help on using the changeset viewer.