Changeset 58443 for trunk/src/wp-includes/class-wp-theme-json-resolver.php
- Timestamp:
- 06/19/2024 04:39:07 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r58429 r58443 173 173 * @param WP_Theme_JSON_Data $theme_json Class to access and update the underlying data. 174 174 */ 175 $theme_json = apply_filters( 'wp_theme_json_data_default', new WP_Theme_JSON_Data( $config, 'default' ) ); 176 static::$core = $theme_json->get_theme_json(); 175 $theme_json = apply_filters( 'wp_theme_json_data_default', new WP_Theme_JSON_Data( $config, 'default' ) ); 176 177 /* 178 * Backward compatibility for extenders returning a WP_Theme_JSON_Data 179 * compatible class that is not a WP_Theme_JSON_Data object. 180 */ 181 if ( $theme_json instanceof WP_Theme_JSON_Data ) { 182 static::$core = $theme_json->get_theme_json(); 183 } else { 184 $config = $theme_json->get_data(); 185 static::$core = new WP_Theme_JSON( $config, 'default' ); 186 } 177 187 178 188 return static::$core; … … 264 274 * @param WP_Theme_JSON_Data $theme_json Class to access and update the underlying data. 265 275 */ 266 $theme_json = apply_filters( 'wp_theme_json_data_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) ); 267 static::$theme = $theme_json->get_theme_json(); 276 $theme_json = apply_filters( 'wp_theme_json_data_theme', new WP_Theme_JSON_Data( $theme_json_data, 'theme' ) ); 277 278 /* 279 * Backward compatibility for extenders returning a WP_Theme_JSON_Data 280 * compatible class that is not a WP_Theme_JSON_Data object. 281 */ 282 if ( $theme_json instanceof WP_Theme_JSON_Data ) { 283 static::$theme = $theme_json->get_theme_json(); 284 } else { 285 $config = $theme_json->get_data(); 286 static::$theme = new WP_Theme_JSON( $config ); 287 } 268 288 269 289 if ( $wp_theme->parent() ) { … … 387 407 * @param WP_Theme_JSON_Data $theme_json Class to access and update the underlying data. 388 408 */ 389 $theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) ); 390 static::$blocks = $theme_json->get_theme_json(); 409 $theme_json = apply_filters( 'wp_theme_json_data_blocks', new WP_Theme_JSON_Data( $config, 'blocks' ) ); 410 411 /* 412 * Backward compatibility for extenders returning a WP_Theme_JSON_Data 413 * compatible class that is not a WP_Theme_JSON_Data object. 414 */ 415 if ( $theme_json instanceof WP_Theme_JSON_Data ) { 416 static::$blocks = $theme_json->get_theme_json(); 417 } else { 418 $config = $theme_json->get_data(); 419 static::$blocks = new WP_Theme_JSON( $config, 'blocks' ); 420 } 421 391 422 return static::$blocks; 392 423 } … … 524 555 */ 525 556 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 526 return $theme_json->get_theme_json(); 557 558 /* 559 * Backward compatibility for extenders returning a WP_Theme_JSON_Data 560 * compatible class that is not a WP_Theme_JSON_Data object. 561 */ 562 if ( $theme_json instanceof WP_Theme_JSON_Data ) { 563 return $theme_json->get_theme_json(); 564 } else { 565 $config = $theme_json->get_data(); 566 return new WP_Theme_JSON( $config, 'custom' ); 567 } 527 568 } 528 569 … … 546 587 547 588 /** This filter is documented in wp-includes/class-wp-theme-json-resolver.php */ 548 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 549 static::$user = $theme_json->get_theme_json(); 589 $theme_json = apply_filters( 'wp_theme_json_data_user', new WP_Theme_JSON_Data( $config, 'custom' ) ); 590 591 /* 592 * Backward compatibility for extenders returning a WP_Theme_JSON_Data 593 * compatible class that is not a WP_Theme_JSON_Data object. 594 */ 595 if ( $theme_json instanceof WP_Theme_JSON_Data ) { 596 static::$user = $theme_json->get_theme_json(); 597 } else { 598 $config = $theme_json->get_data(); 599 static::$user = new WP_Theme_JSON( $config, 'custom' ); 600 } 550 601 551 602 return static::$user;
Note: See TracChangeset
for help on using the changeset viewer.