Skip to content
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

Change the 'WP_Theme_JSON_Data_Gutenberg' class directory #50062

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

Mamaduka
Copy link
Member

What?

This is a follow-up to #46750.

PR moves the WP_Theme_JSON_Data_Gutenberg bundled class into the correct directory and matches PHPDoc-blocks to the core.

Why?

The class is always bundled in the plugin and doesn't depend on the support WP version.

Testing Instructions

PR is just changing file directories. Confirm the are no PHP errors/notices when running this branch.

@Mamaduka Mamaduka requested a review from oandregal April 25, 2023 14:08
@Mamaduka Mamaduka self-assigned this Apr 25, 2023
@Mamaduka Mamaduka added [Type] Code Quality Issues or PRs that relate to code quality Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Apr 25, 2023
@Mamaduka Mamaduka changed the title Move the 'WP_Theme_JSON_Data_Gutenberg' class out of the compat dir Change the 'WP_Theme_JSON_Data_Gutenberg' class directory Apr 25, 2023
@oandregal
Copy link
Member

Thanks for this. Unlike the other two classes, this one didn't receive any other update since it landed. It sounds like it can be beneficial to "let it go": remove it once the minimum WordPress version of Gutenberg is raised to 6.1. We did the same with other classes we did not update: WP_Theme_JSON_Schema, for example.

@Mamaduka
Copy link
Member Author

@oandregal, the core class will use WP_Theme_JSON instead of WP_Theme_JSON_Gutenberg, wouldn't that be a problem?

P.S. I noticed this class in the wrong dir when I started working on dropping the WP 6.1 support.

@Mamaduka
Copy link
Member Author

Mamaduka commented Apr 26, 2023

@oandregal, I confirmed that new block features like "position" stop working (WP 6.1.) without bundling this class in the plugin.

The core version uses WP_Theme_JSON, while the plugin code should always use WP_Theme_JSON_Gutenberg to access the latest features.

Edit: I will merge this minor change to unblock #50079. I'm happy to do a follow-up if there's a different way to solve the block position support issue.

@Mamaduka Mamaduka merged commit e6450b2 into trunk Apr 26, 2023
@Mamaduka Mamaduka deleted the fix/bundle-theme-json-data branch April 26, 2023 10:48
@github-actions github-actions bot added this to the Gutenberg 15.7 milestone Apr 26, 2023
@oandregal
Copy link
Member

Oh, you are absolutely right, @Mamaduka It uses the class internally, so it needs to point to the Gutenberg one. Thanks for taking care of it.

@ramonjd ramonjd added the Needs PHP backport Needs PHP backport to Core label Jun 5, 2023
@ramonjd ramonjd removed the Needs PHP backport Needs PHP backport to Core label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants