Changeset 64309 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 10/12/2026 08:18:48 AM (33 hours ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-theme-json.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r64304 r64309 1141 1141 $scale_path = array( 'settings', 'spacing', 'spacingScale' ); 1142 1142 $spacing_scale = _wp_array_get( $this->theme_json, $scale_path, null ); 1143 if ( null !== $spacing_scale) {1143 if ( is_array( $spacing_scale ) ) { 1144 1144 // If the spacingScale is not already keyed by origin. 1145 1145 if ( empty( array_intersect( array_keys( $spacing_scale ), static::VALID_ORIGINS ) ) ) { … … 1215 1215 $block_level_data = $new_theme_json['styles']['blocks'][ $block_type ]['variations'][ $variation_name ] ?? array(); 1216 1216 $top_level_data = $variations[ $variation_name ] ?? array(); 1217 $merged_data = array_replace_recursive( $top_level_data, $block_level_data ); 1217 if ( ! is_array( $block_level_data ) || ! is_array( $top_level_data ) ) { 1218 continue; 1219 } 1220 $merged_data = array_replace_recursive( $top_level_data, $block_level_data ); 1218 1221 if ( ! empty( $merged_data ) ) { 1219 1222 _wp_array_set( $new_theme_json, array( 'styles', 'blocks', $block_type, 'variations', $variation_name ), $merged_data ); … … 1494 1497 $variation_pseudo_selectors = array(); 1495 1498 foreach ( $input['blockTypes'] as $variation_block_type ) { 1496 if ( is set( static::VALID_BLOCK_PSEUDO_SELECTORS[ $variation_block_type ] ) ) {1499 if ( is_string( $variation_block_type ) && isset( static::VALID_BLOCK_PSEUDO_SELECTORS[ $variation_block_type ] ) ) { 1497 1500 $variation_pseudo_selectors = array_merge( 1498 1501 $variation_pseudo_selectors, … … 2102 2105 if ( in_array( 'custom-css', $types, true ) ) { 2103 2106 // Add the global styles root CSS. 2104 $stylesheet .= _wp_array_get( $this->theme_json, array( 'styles', 'css' ) ); 2107 $root_css = $this->theme_json['styles']['css'] ?? ''; 2108 if ( is_string( $root_css ) ) { 2109 $stylesheet .= $root_css; 2110 } 2105 2111 } 2106 2112 … … 2122 2128 $processed_css = ''; 2123 2129 2124 if ( empty( $css ) ) {2130 if ( empty( $css ) || ! is_string( $css ) ) { 2125 2131 return $processed_css; 2126 2132 } … … 3242 3248 * the URL takes precedence and the ref is ignored. 3243 3249 */ 3244 if ( is_array( $value ) && isset( $value['ref'] ) ) {3250 if ( is_array( $value ) && isset( $value['ref'] ) && is_string( $value['ref'] ) ) { 3245 3251 $value_path = explode( '.', $value['ref'] ); 3246 3252 $ref_value = _wp_array_get( $theme_json, $value_path ); … … 4432 4438 4433 4439 // Apply the base spacing scale to the current layer. 4434 $base_spacing_scale = _wp_array_get( $this->theme_json, $scale_path, array() ); 4435 $flattened_spacing_scale = array_replace( $flattened_spacing_scale, $base_spacing_scale ); 4440 $base_spacing_scale = _wp_array_get( $this->theme_json, $scale_path, array() ); 4441 if ( is_array( $base_spacing_scale ) ) { 4442 $flattened_spacing_scale = array_replace( $flattened_spacing_scale, $base_spacing_scale ); 4443 } 4436 4444 4437 4445 $spacing_scale = _wp_array_get( $incoming_data, $scale_path, null ); 4438 if ( ! is set( $spacing_scale ) ) {4446 if ( ! is_array( $spacing_scale ) ) { 4439 4447 continue; 4440 4448 } … … 5570 5578 ! is_numeric( $spacing_scale['mediumStep'] ) || 5571 5579 ! isset( $spacing_scale['unit'] ) || 5580 ! is_string( $spacing_scale['unit'] ) || 5572 5581 ! isset( $spacing_scale['operator'] ) || 5573 5582 ( '+' !== $spacing_scale['operator'] && '*' !== $spacing_scale['operator'] ) ||
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)