-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block transforms don't have access to inner blocks #13052
Comments
I'm on the fence but marking this as a bug for now. |
I apologize if this is the wrong place to add this comment. We're building functionality to allow one block to transform into another where both blocks use inner blocks. We're testing this on WordPress 5.1, but the functionality doesn't seem to exist there yet. This was more confusing for us since at https://wordpress.org/gutenberg/handbook/designers-developers/developers/block-api/block-registration/#transforms-optional it notes this is possible and provides a code example. Do you have an idea of when this is going to be part of WordPress core and do you think the documentation should be updated to remove these examples until that time comes? Thanks a lot for the help. |
I'm following up on my last comment here about inner blocks and the transforms. Let me know if I should be posting somewhere else. Thanks a ton. |
@jg314 Hi there! this feature will be possible starting from WordPress 5.2 (or by installing the Gutenberg plugin currently). We have a problem right now with the handbook because it's synchronizing the docs from master. |
Thanks a ton for the response @youknowriad. Is there anywhere we can see which version of the Gutenberg plugin is in core? |
In Core, there's no direct mapping between Gutenberg versions and the code shipped in Core as sometimes we backport bug fixes. WordPress 5.1 and WordPRess 5.1.1 is based on Gutenberg 4.7 + some fixes. |
Got it. Thanks a lot for the quick response @youknowriad. I really appreciate it. |
Describe the bug
Block transform functions receive a block's attributes, but they do not receive inner blocks. This makes it impractical to write transforms for parent blocks that use inner block content.
It's conceivable a plugin might want to offer a transform from a slideshow block to some other kind of block, perhaps a gallery. But this does not appear possible with the current transform API.
Expected behavior
A transform function would receive inner block types and attributes as well.
The text was updated successfully, but these errors were encountered: