Changeset 55086 for trunk/src/wp-includes/class-wp-theme-json-resolver.php
- Timestamp:
- 01/18/2023 11:38:16 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json-resolver.php
r55067 r55086 59 59 60 60 /** 61 * Whether or not the theme supports theme.json.62 *63 * @since 5.8.064 * @var bool65 */66 protected static $theme_has_support = null;67 68 /**69 61 * Container for data coming from the user. 70 62 * … … 296 288 */ 297 289 $theme_support_data = WP_Theme_JSON::get_from_editor_settings( get_default_block_editor_settings() ); 298 if ( ! static::theme_has_support() ) {290 if ( ! wp_theme_has_theme_json() ) { 299 291 if ( ! isset( $theme_support_data['settings']['color'] ) ) { 300 292 $theme_support_data['settings']['color'] = array(); … … 422 414 * Bail early if the theme does not support a theme.json. 423 415 * 424 * Since WP_Theme_JSON_Resolver::theme_has_support() only supports the active416 * Since wp_theme_has_theme_json() only supports the active 425 417 * theme, the extra condition for whether $theme is the active theme is 426 418 * present here. 427 419 */ 428 if ( $theme->get_stylesheet() === get_stylesheet() && ! static::theme_has_support() ) {420 if ( $theme->get_stylesheet() === get_stylesheet() && ! wp_theme_has_theme_json() ) { 429 421 return array(); 430 422 } … … 603 595 * @since 5.8.0 604 596 * @since 5.9.0 Added a check in the parent theme. 597 * @deprecated 6.2.0 Use wp_theme_has_theme_json() instead. 605 598 * 606 599 * @return bool 607 600 */ 608 601 public static function theme_has_support() { 609 if ( ! isset( static::$theme_has_support ) ) { 610 static::$theme_has_support = ( 611 static::get_file_path_from_theme( 'theme.json' ) !== '' || 612 static::get_file_path_from_theme( 'theme.json', true ) !== '' 613 ); 614 } 615 616 return static::$theme_has_support; 602 _deprecated_function( __METHOD__, '6.2.0', 'wp_theme_has_theme_json()' ); 603 604 return wp_theme_has_theme_json(); 617 605 } 618 606 … … 657 645 static::$user = null; 658 646 static::$user_custom_post_type_id = null; 659 static::$theme_has_support = null;660 647 static::$i18n_schema = null; 661 648 }
Note: See TracChangeset
for help on using the changeset viewer.