Skip to content

Commit 67fe26f

Browse files
authored
Deprecate WP_Theme_JSON_Resolver:theme_has_support() (#45380)
1 parent df98b4b commit 67fe26f

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* WP_Theme_JSON_Resolver_6_1 class
4+
*
5+
* @package gutenberg
6+
*/
7+
8+
/**
9+
* Class that abstracts the processing of the different data sources
10+
* for site-level config and offers an API to work with them.
11+
*
12+
* This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes).
13+
* This is a low-level API that may need to do breaking changes. Please,
14+
* use get_global_settings, get_global_styles, and get_global_stylesheet instead.
15+
*
16+
* @access private
17+
*/
18+
class WP_Theme_JSON_Resolver_6_2 extends WP_Theme_JSON_Resolver_6_1 {
19+
20+
/**
21+
* Determines whether the active theme has a theme.json file.
22+
*
23+
* @since 5.8.0
24+
* @since 5.9.0 Added a check in the parent theme.
25+
* @deprecated 6.2.0 Use wp_theme_has_theme_json() instead.
26+
*
27+
* @return bool
28+
*/
29+
public static function theme_has_support() {
30+
_deprecated_function( __METHOD__, '6.2.0', 'wp_theme_has_theme_json()' );
31+
32+
return wp_theme_has_theme_json();
33+
}
34+
35+
}

lib/experimental/class-wp-theme-json-resolver-gutenberg.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* @access private
1717
*/
18-
class WP_Theme_JSON_Resolver_Gutenberg extends WP_Theme_JSON_Resolver_6_1 {
18+
class WP_Theme_JSON_Resolver_Gutenberg extends WP_Theme_JSON_Resolver_6_2 {
1919
/**
2020
* Returns the theme's data.
2121
*

lib/load.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ function gutenberg_is_experiment_enabled( $name ) {
8888
require __DIR__ . '/compat/wordpress-6.1/block-editor-settings.php';
8989
require __DIR__ . '/compat/wordpress-6.1/persisted-preferences.php';
9090
require __DIR__ . '/compat/wordpress-6.1/get-global-styles-and-settings.php';
91-
require __DIR__ . '/compat/wordpress-6.2/get-global-styles-and-settings.php';
92-
require __DIR__ . '/compat/wordpress-6.2/default-filters.php';
9391
require __DIR__ . '/compat/wordpress-6.1/class-wp-theme-json-data-gutenberg.php';
9492
require __DIR__ . '/compat/wordpress-6.1/class-wp-theme-json-6-1.php';
9593
require __DIR__ . '/compat/wordpress-6.1/class-wp-theme-json-resolver-6-1.php';
@@ -104,6 +102,9 @@ function gutenberg_is_experiment_enabled( $name ) {
104102

105103
// WordPress 6.2 compat.
106104
require __DIR__ . '/compat/wordpress-6.2/script-loader.php';
105+
require __DIR__ . '/compat/wordpress-6.2/get-global-styles-and-settings.php';
106+
require __DIR__ . '/compat/wordpress-6.2/default-filters.php';
107+
require __DIR__ . '/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php';
107108

108109
// Experimental features.
109110
remove_action( 'plugins_loaded', '_wp_theme_json_webfonts_handler' ); // Turns off WP 6.0's stopgap handler for Webfonts API.

0 commit comments

Comments
 (0)