Skip to content

Commit

Permalink
6.2: deprecate theme_has_support
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Dec 22, 2022
1 parent 811fc7d commit f4c6c01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 31 deletions.
19 changes: 3 additions & 16 deletions lib/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ class WP_Theme_JSON_Resolver_Base {
*/
protected static $theme = null;

/**
* Whether or not the theme supports theme.json.
*
* @since 5.8.0
* @var bool
*/
protected static $theme_has_support = null;

/**
* Container for data coming from the user.
*
Expand Down Expand Up @@ -596,18 +588,14 @@ public static function get_user_global_styles_post_id() {
*
* @since 5.8.0
* @since 5.9.0 Added a check in the parent theme.
* @deprecated 6.2.0 Use wp_theme_has_theme_json() instead.
*
* @return bool
*/
public static function theme_has_support() {
if ( ! isset( static::$theme_has_support ) ) {
static::$theme_has_support = (
static::get_file_path_from_theme( 'theme.json' ) !== '' ||
static::get_file_path_from_theme( 'theme.json', true ) !== ''
);
}
_deprecated_function( __METHOD__, '6.2.0', 'wp_theme_has_theme_json()' );

return static::$theme_has_support;
return wp_theme_has_theme_json();
}

/**
Expand Down Expand Up @@ -650,7 +638,6 @@ public static function clean_cached_data() {
static::$theme = null;
static::$user = null;
static::$user_custom_post_type_id = null;
static::$theme_has_support = null;
static::$i18n_schema = null;
}

Expand Down
15 changes: 0 additions & 15 deletions lib/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,6 @@ public static function get_user_data_from_wp_global_styles( $theme, $create_post
return $user_cpt;
}

/**
* Determines whether the active theme has a theme.json file.
*
* @since 5.8.0
* @since 5.9.0 Added a check in the parent theme.
* @deprecated 6.2.0 Use wp_theme_has_theme_json() instead.
*
* @return bool
*/
public static function theme_has_support() {
_deprecated_function( __METHOD__, '6.2.0', 'wp_theme_has_theme_json()' );

return wp_theme_has_theme_json();
}

/**
* Returns the data merged from multiple origins.
*
Expand Down

0 comments on commit f4c6c01

Please sign in to comment.