-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Global Styles: Make the dependency of the star matcher explicit when translating theme.json
#30604
Conversation
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.
Nice improvement, thank you for making it more useful than before 😄
The next step would be to make it a general-purpose utility and refactor register_block_type_from_metadata
in WordPress core ✨
You still need to fix coding style violations to move forward with this refactoring: https://github.com/WordPress/gutenberg/pull/30604/checks?check_run_id=2295013361
theme.json
Size Change: 0 B Total Size: 1.42 MB ℹ️ View Unchanged
|
5a17c4f
to
33bbf6e
Compare
Extracted from #30541 so it can land in pieces and make reviews easier/quicker.
This PR improves the logic that processes the paths to translate. Instead of looking for
settings
it looks for the*
element, which indicates that we should iterate over elements in that path. By making that dependency explicit, changes like those we plan at #30541 don't require any modifications in this code.How to test
npm run test-unit-php /var/www/html/wp-content/plugins/gutenberg/phpunit/class-wp-theme-json-resolver-test.php