From f4c6c01fe85d9df5b69db5b8458ee67183c4e952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= <583546+oandregal@users.noreply.github.com> Date: Thu, 22 Dec 2022 15:16:15 +0100 Subject: [PATCH] 6.2: deprecate theme_has_support https://github.com/WordPress/gutenberg/pull/45380/ --- lib/class-wp-theme-json-resolver.php | 19 +++---------------- .../class-wp-theme-json-resolver-6-2.php | 15 --------------- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/lib/class-wp-theme-json-resolver.php b/lib/class-wp-theme-json-resolver.php index d1b8cb376ec67a..e622e937846e81 100644 --- a/lib/class-wp-theme-json-resolver.php +++ b/lib/class-wp-theme-json-resolver.php @@ -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. * @@ -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(); } /** @@ -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; } diff --git a/lib/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php b/lib/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php index fa85d34c520730..d25d6df090c069 100644 --- a/lib/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php +++ b/lib/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php @@ -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. *