Changeset 61621
- Timestamp:
- 02/12/2026 07:40:48 AM (2 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-theme-json.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r61620 r61621 2942 2942 2943 2943 // Process pseudo-selectors for this variation (e.g., :hover, :focus) 2944 $block_name = isset( $block_metadata['name'] ) ? $block_metadata['name'] : ( in_array( 'blocks', $block_metadata['path'], true ) && count( $block_metadata['path'] ) >= 3 ? $block_metadata['path'][2] : null ); 2944 if ( isset( $block_metadata['name'] ) ) { 2945 $block_name = $block_metadata['name']; 2946 } elseif ( in_array( 'blocks', $block_metadata['path'], true ) && count( $block_metadata['path'] ) >= 3 ) { 2947 $block_name = $block_metadata['path'][2]; 2948 } else { 2949 $block_name = null; 2950 } 2945 2951 $variation_pseudo_declarations = static::process_pseudo_selectors( $style_variation_node, $style_variation['selector'], $settings, $block_name ); 2946 2952 $style_variation_declarations = array_merge( $style_variation_declarations, $variation_pseudo_declarations ); … … 3031 3037 $block_name = $block_metadata['path'][2]; // 'core/button' 3032 3038 $block_data = _wp_array_get( $this->theme_json, array( 'styles', 'blocks', $block_name ), array() ); 3033 $pseudo_data = isset( $block_data[ $block_pseudo_selector ] ) ? $block_data[ $block_pseudo_selector ] :array();3039 $pseudo_data = $block_data[ $block_pseudo_selector ] ?? array(); 3034 3040 3035 3041 $declarations = static::compute_style_properties( $pseudo_data, $settings, null, $this->theme_json, $selector, $use_root_padding );
Note: See TracChangeset
for help on using the changeset viewer.