-
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
Move Global Styles code to lib/compat/wordpress-5.9
folder
#36978
Conversation
ed7ab59
to
cf351bb
Compare
I've tested that moving the
The expected result is that there's a #: lib/compat/wordpress-5.9/theme.json
msgctxt "Font size name"
msgid "Small"
msgstr ""
#: lib/compat/wordpress-5.9/theme.json
msgctxt "Font size name"
msgid "Normal"
msgstr ""
# etc. |
Marked as to backport to make sure this lands in Gutenberg's |
Do we need to move |
Yeah, we should. |
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 tests well for me 👍
✅ Automated tests pass
✅ Styles appeared as per normal in post editor, site editor and frontend
(tested with TT1 Blocks & TwentyTwentyTwo)
✅ Presets, such as colors and font sizes, were present in both block inspector and global styles sidebar
✅ I18n ran successfully, relocated theme.json entries were present and matching in generated .pot
file
There was one failing test when running npm run test-php
though that was fixed in #36987 yesterday.
The reasoning for moving theme.json as well makes sense to me also.
What happens now with WordPress trunk? Do we still load these classes instead of Core, should we guard against that (to avoid having folks changing these files inadvertently and forgetting the backport) |
Yeah, we use these classes instead of WordPress
I think a goal for 6.0 should be to 1) create the public methods for the things that don't have them yet and 2) use those methods everywhere so the classes aren't used directly. For most of the code should be straightforward and I can start doing that already.
I'm hoping that changing code that lives in Do you think having this safeguard is a blocker for this merging this PR? I ask because I see that there's more code that does the same (the plugin uses the version from |
No, I don't think it's a blocker but it shouldn't be too complex to add. @talldan is doing something similar in https://github.com/WordPress/gutenberg/pull/36898/files#diff-e0498912315fab82090a3c4953f6f616455946b41a885dd0a131e22a261d0475R16 |
Follow up for global styles CPT registration at #37282 |
Related #36957 (comment)
Depends on #36974This PR moves the global styles classes code under
lib/compat/wordpress-5.9
folder. The rationale for this is to make sure we have a path to remove this code from the plugin.Files moved to the 5.9 directory:
lib/class-wp-theme-json-gutenberg.php
lib/class-wp-theme-json-resolver-gutenberg.php
lib/class-wp-theme-json-schema-gutenberg.php
lib/theme.json
lib/theme-i18n.json
How to test