Theme JSON: include block style variations in path only output of get_block_nodes #66948
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 👍🏻