-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix: use WP_Theme_JSON_Gutenberg instead of WP_Theme_JSON class #74294
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
Fix: use WP_Theme_JSON_Gutenberg instead of WP_Theme_JSON class #74294
Conversation
Replace WP_Theme_JSON class references with WP_Theme_JSON_Gutenberg in plugin code and update PHPDoc type hints to use the correct Gutenberg variant class. Per lib/README.md, Gutenberg uses the _Gutenberg suffix for "evergreen" classes to ensure plugin users get the latest code even on older WordPress versions. Fixes #63421
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
| * | ||
| * @since 6.1.0 | ||
| * @var WP_Theme_JSON | ||
| * @var WP_Theme_JSON_Gutenberg |
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.
I would probably leave similar comments in place, as it makes it easier to diff backports.
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.
Good point I reverted this change.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @fstath. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 6888a9f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20623881017
|
Per
lib/README.md, Gutenberg uses the_Gutenbergsuffix for "evergreen" classes to ensure plugin users get the latest code even on older WordPress versions.More specically in this case we should reference in Gutenberg WP_Theme_JSON_Gutenberg instead of WP_Theme_JSON otherwise we will use core code instead of the Gutenberg while when we have Gutenberg it is expected that Gutenberg code is used
This PR does two simple changes
WP_Theme_JSONclass references withWP_Theme_JSON_Gutenbergin plugin codeTesting
Do a general smoke testing to global styles.
Do some grepping to confirm we don't have any other WP_Theme_JSON usage.