Changeset 61564 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 01/30/2026 02:09:32 AM (8 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-theme-json.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r61473 r61564 1616 1616 $has_block_gap_support = isset( $this->theme_json['settings']['spacing']['blockGap'] ); 1617 1617 $has_fallback_gap_support = ! $has_block_gap_support; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback gap styles support. 1618 $node = _wp_array_get( $this->theme_json, $block_metadata['path'], array() );1618 $node = $options['node'] ?? _wp_array_get( $this->theme_json, $block_metadata['path'], array() ); 1619 1619 $layout_definitions = wp_get_layout_definitions(); 1620 1620 $layout_selector_pattern = '/^[a-zA-Z0-9\-\.\,\ *+>:\(\)]*$/'; // Allow alphanumeric classnames, spaces, wildcard, sibling, child combinator and pseudo class selectors. … … 2357 2357 } 2358 2358 2359 /*2360 * Look up protected properties, keyed by value path.2361 * Skip protected properties that are explicitly set to `null`.2362 */2363 $path_string = implode( '.', $value_path );2364 if (2365 isset( static::PROTECTED_PROPERTIES[ $path_string ] ) &&2366 _wp_array_get( $settings, static::PROTECTED_PROPERTIES[ $path_string ], null ) === null2367 ) {2368 continue;2369 }2370 2371 2359 // Calculates fluid typography rules where available. 2372 2360 if ( 'font-size' === $css_property ) { … … 2812 2800 2813 2801 // If there are style variations, generate the declarations for them, including any feature selectors the block may have. 2814 $style_variation_declarations = array(); 2815 $style_variation_custom_css = array(); 2802 $style_variation_declarations = array(); 2803 $style_variation_custom_css = array(); 2804 $style_variation_layout_metadata = array(); 2816 2805 if ( ! empty( $block_metadata['variations'] ) ) { 2817 2806 foreach ( $block_metadata['variations'] as $style_variation ) { … … 2852 2841 if ( isset( $style_variation_node['css'] ) ) { 2853 2842 $style_variation_custom_css[ $style_variation['selector'] ] = $this->process_blocks_custom_css( $style_variation_node['css'], $style_variation['selector'] ); 2843 } 2844 2845 // Store variation metadata and node for layout styles generation. 2846 // Only store if the variation has blockGap defined. 2847 if ( isset( $style_variation_node['spacing']['blockGap'] ) ) { 2848 // Append block selector to the variation selector for proper targeting. 2849 $variation_metadata_with_selector = $style_variation; 2850 $variation_metadata_with_selector['selector'] = $style_variation['selector'] . $block_metadata['css']; 2851 $style_variation_layout_metadata[ $style_variation['selector'] ] = array( 2852 'metadata' => $variation_metadata_with_selector, 2853 'node' => $style_variation_node, 2854 ); 2854 2855 } 2855 2856 } … … 3005 3006 foreach ( $style_variation_declarations as $style_variation_selector => $individual_style_variation_declarations ) { 3006 3007 $block_rules .= static::to_ruleset( ":root :where($style_variation_selector)", $individual_style_variation_declarations ); 3008 if ( isset( $style_variation_layout_metadata[ $style_variation_selector ] ) ) { 3009 $variation_data = $style_variation_layout_metadata[ $style_variation_selector ]; 3010 $block_rules .= $this->get_layout_styles( $variation_data['metadata'], array( 'node' => $variation_data['node'] ) ); 3011 } 3007 3012 if ( isset( $style_variation_custom_css[ $style_variation_selector ] ) ) { 3008 3013 $block_rules .= $style_variation_custom_css[ $style_variation_selector ]; … … 3080 3085 } 3081 3086 3082 // Block gap styles will be output unless explicitly set to `null`. See static::PROTECTED_PROPERTIES.3087 // Block gap styles will be output unless explicitly set to `null`. 3083 3088 if ( isset( $this->theme_json['settings']['spacing']['blockGap'] ) ) { 3084 3089 $block_gap_value = static::get_property_value( $this->theme_json, array( 'styles', 'spacing', 'blockGap' ) );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)