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
|
aaronrobertshaw
left a comment
There was a problem hiding this comment.
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' => trueDiscussed here: https://github.com/WordPress/gutenberg/pull/66731/files#r1830311575
cc @mukeshpanchal27
Why?
#66002 added and
$include_node_paths_onlyoption toget_block_nodes()to improve performance.When
truethis 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_onlycondition block.Testing Instructions
PHP unit tests should pass.
Smoke test the editor. Should be all 👍🏻