Skip to content

Conversation

@jorgefilipecosta
Copy link
Member

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.
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

  • Replace WP_Theme_JSON class references with WP_Theme_JSON_Gutenberg in plugin code
  • Update PHPDoc type hints to use the correct Gutenberg variant class

Testing

Do a general smoke testing to global styles.
Do some grepping to confirm we don't have any other WP_Theme_JSON usage.

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
@jorgefilipecosta jorgefilipecosta added [Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality labels Dec 31, 2025
@github-actions
Copy link

github-actions bot commented Dec 31, 2025

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.

  • Required label: Any label starting with [Type].
  • Labels found: [Type] Bug, [Type] Code Quality, No Core Sync Required.

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.

@jorgefilipecosta jorgefilipecosta added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Dec 31, 2025
*
* @since 6.1.0
* @var WP_Theme_JSON
* @var WP_Theme_JSON_Gutenberg
Copy link
Member

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.

Copy link
Member Author

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.

@github-actions
Copy link

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 props-bot label.

Unlinked Accounts

The 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.

Unlinked contributors: fstath.

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: Rishit30G <rishit30g@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

github-actions bot commented Dec 31, 2025

Flaky tests detected in 6888a9f.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20623881017
📝 Reported issues:

@jorgefilipecosta jorgefilipecosta merged commit 6e311e8 into trunk Dec 31, 2025
40 checks passed
@jorgefilipecosta jorgefilipecosta deleted the fix/63421-use-wp-theme-json-gutenberg branch December 31, 2025 18:00
@github-actions github-actions bot added this to the Gutenberg 22.4 milestone Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Bug An existing feature does not function as intended [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typo: use WP_Theme_JSON_Gutenberg instead of WP_Theme_JSON class

3 participants