Update block-transforms.md Using transforms with createBlocksFromInne… #60957
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.
The documentation covers the case of converting one block that includes InnerBlocks to another block with InnerBlocks. Suggest explaining how to create an InnerBlocks template from code. Example: creating a single block that outputs database content to a Query Loop with an InnerBlocks template.
What?
Adding an additional example to the Transforms page for single block -> multiple block transformations
Why?
Using createBlocksFromInnerBlocksTemplate makes this type of transformation possible but is not documented in this context.
How?
Providing an abstracted description of a solution I used for my own plugin. (blog post)[https://davidfcarr.com/transforming-a-single-wordpress-block-into-a-block-variation-with-innerblocks/]
Testing Instructions
Add the sample code to a block registration definition.
Test that the transformation is displayed in the Transform To UI and that it works.
Testing Instructions for Keyboard
N/A
Screenshots or screencast
N/A
[Type] Developer Documentation