-
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
Try: bundle WP_REST_Global_Styles_Controller class instead of inheriting per WordPress version #53618
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/class-wp-rest-global-styles-controller-gutenberg.php ❔ lib/rest-api.php ❔ lib/compat/wordpress-6.4/rest-api.php ❔ lib/load.php ❔ phpunit/class-wp-rest-global-styles-controller-gutenberg-test.php |
Flaky tests detected in c8f3f3e213fff1c7e47756d5321139a88ddf9284. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5852630758
|
@michalczaplinski Sorry, I think I missed something in relation to 'behaviors'. The E2E tests are failing. Trying to find it, but am code blind. 😅 |
Never mind. User error. Forgot to import a file and got too excited 🤦🏻 All is well. |
…s and ensure the response always reflects changes from WP_Theme_JSON_Gutenberg
Apparently
… block comment" and "Empty lines are not allowed in multi-line function calls" rules. Which one will prevail? For now just use single line comments to shut them both up.
Rename unit test
c8f3f3e
to
111c7e0
Compare
What?
Similar to:
WP_Theme_JSON
class instead of inheriting per WordPress version #46579This PR bundles rest global styles controller code into one class
WP_REST_Global_Styles_Controller
to avoid conflicts, and to make sure the response always reflects changes fromWP_Theme_JSON_Gutenberg
.The
WP_REST_Global_Styles_Controller
is the endpoint that fetches the contents of the theme global styles custom post from the database.Why?
Context for change: https://github.com/WordPress/gutenberg/pull/53451/files#r1289969201
For many of the reasons cited in #46579, but also because the underlying response is directly affected by changes to
WP_Theme_JSON_Gutenberg
.How?
Removing all extensions in
lib/compat
and creating an "evergreen" file under/lib
.Testing Instructions
Check that all tests pass on CI.
Ensure both classic (TwentyTwenty) and block themes (TwentyTwentyThree) load properly and that any presets are loaded and work correctly.
For block themes, perform some common global styles-related functions, e.g.,
In the site editor, check that the endpoint returns the current merged theme.json. Run this command in the browser console:
In the site editor, make some changes to the global styles (e.g.,: select a different style variation, add a custom color palette). Refresh the page and verify they are applied everywhere (editor, front-end).
Check that the revisions count in the global styles revisions drop down is accurate