-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Theme JSON: remove redundant check and relocate $selectors assignment #7575
Theme JSON: remove redundant check and relocate $selectors assignment #7575
Conversation
…e_JSON::get_blocks_metadata() is only called if necessary.
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 Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
@ramonjd Good if we commit for 6.7. WDYT? |
Thank you, yes! |
Updated with code suggestion. Ready for final ✔️ |
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.
🎉
@ramonjd Move into 6.7 and commit when you have moment. |
Backport from WordPress/wordpress-develop#7575 Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Backport from WordPress/wordpress-develop#7575 Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org> Source: WordPress/gutenberg@0b972a8
Backporting:
What? Why? How?
In
WP_Theme_JSON::get_block_nodes()
, remove redundant check for$theme_json['styles']
, which meansWP_Theme_JSON::get_blocks_metadata()
is only called if necessary.This also has the potential to slightly improve the performance of functions such as wp_add_global_styles_for_blocks that call
WP_Theme_JSON::get_styles_block_nodes()
, where no block styles exist.Testing Instructions
CI tests should pass.
Smoke test in a block theme with lots of block styles, like TT4 and a theme with none, like Emptytheme
Trac ticket: https://core.trac.wordpress.org/ticket/62234