-
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
Theme JSON: include block style variations in path only output of get_block_nodes #66948
Conversation
Including variations in the nodes array when 'include_node_paths_only' => true
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Flaky tests detected in 5a5a99b. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11810291831
|
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 fixing this up @ramonjd 👍
✅ Unit tests are passing
✅ Variation paths in include_node_paths_only
flow are now consistent
✅ Smoke tested mostly in TT5 focusing on block style variations etc. No issues found.
LGTM 🚢
Thanks for the quick review! |
What?
Follow up to #66002
Including variations in the nodes array when
'include_node_paths_only' => true
Discussed here: https://github.com/WordPress/gutenberg/pull/66731/files#r1830311575
cc @mukeshpanchal27
Why?
#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 👍🏻