-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate WP_Theme_JSON_Resolver:theme_has_support()
#45380
Merged
+39
−3
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
lib/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* WP_Theme_JSON_Resolver_6_1 class | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* Class that abstracts the processing of the different data sources | ||
* for site-level config and offers an API to work with them. | ||
* | ||
* This class is for internal core usage and is not supposed to be used by extenders (plugins and/or themes). | ||
* This is a low-level API that may need to do breaking changes. Please, | ||
* use get_global_settings, get_global_styles, and get_global_stylesheet instead. | ||
* | ||
* @access private | ||
*/ | ||
class WP_Theme_JSON_Resolver_6_2 extends WP_Theme_JSON_Resolver_6_1 { | ||
|
||
/** | ||
* 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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,8 +88,6 @@ function gutenberg_is_experiment_enabled( $name ) { | |
require __DIR__ . '/compat/wordpress-6.1/block-editor-settings.php'; | ||
require __DIR__ . '/compat/wordpress-6.1/persisted-preferences.php'; | ||
require __DIR__ . '/compat/wordpress-6.1/get-global-styles-and-settings.php'; | ||
require __DIR__ . '/compat/wordpress-6.2/get-global-styles-and-settings.php'; | ||
require __DIR__ . '/compat/wordpress-6.2/default-filters.php'; | ||
require __DIR__ . '/compat/wordpress-6.1/class-wp-theme-json-data-gutenberg.php'; | ||
require __DIR__ . '/compat/wordpress-6.1/class-wp-theme-json-6-1.php'; | ||
require __DIR__ . '/compat/wordpress-6.1/class-wp-theme-json-resolver-6-1.php'; | ||
|
@@ -104,6 +102,9 @@ function gutenberg_is_experiment_enabled( $name ) { | |
|
||
// WordPress 6.2 compat. | ||
require __DIR__ . '/compat/wordpress-6.2/script-loader.php'; | ||
require __DIR__ . '/compat/wordpress-6.2/get-global-styles-and-settings.php'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In #45168 I missed the place where these imports should be located. |
||
require __DIR__ . '/compat/wordpress-6.2/default-filters.php'; | ||
require __DIR__ . '/compat/wordpress-6.2/class-wp-theme-json-resolver-6-2.php'; | ||
|
||
// Experimental features. | ||
remove_action( 'plugins_loaded', '_wp_theme_json_webfonts_handler' ); // Turns off WP 6.0's stopgap handler for Webfonts API. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still calling the public method, so existing consumers will still work. This is in case consumers outside of WordPress core were using this private method in a production environment. We don't want them to fail.