-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: include block style variations in path only output of get_block_nodes #7784
Theme JSON: include block style variations in path only output of get_block_nodes #7784
Conversation
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. |
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. |
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.
Thanks for this one @ramonjd 👍
This is testing well for me.
✅ Code matches Gutenberg PR
✅ Theme.json tests are passing
✅ Tested using TT5 and its block style variations. No regressions spotted.
I only had one minor nit, to include @ticket 61858
, then this should be good to go 🚢
Screen.Recording.2024-11-19.at.10.37.14.am.mp4
Co-authored-by: Aaron Robertshaw <[email protected]>
Thanks for testing @aaronrobertshaw! |
Syncing Gutenberg PR:
Follow up to:
WP_Theme_JSON::merge
when merging background styles #7486Including variations in the nodes array when 'include_node_paths_only' => true
Discussed here: https://github.com/WordPress/gutenberg/pull/66731/files#r1830311575
Why?
WordPress/gutenberg#66002 added and
$include_node_paths_only
option toget_block_nodes()
to improve performance.When
true
this option tells the function to only return paths, and not selectors, for consumers that only needed paths to style values.For one of the conditional blocks, block style variations wasn't included.
This PR adds them to the array of paths following the existing model
$node[]['path' => [], 'variations' => ['path' => []]]
How?
Just adding the same loop but in the
$include_node_paths_only
condition block.Testing Instructions
PHP unit tests should pass.
Smoke test the editor. Should be all 👍🏻
Trac ticket: https://core.trac.wordpress.org/ticket/62399
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.