Setting 'parent' restriction in block API (block metadata) does not prevent the block from being transformed (wrapped) by group and column blocks. #66645
The parent block API is not being honored by the transform options "Columns" and "Group" (and "Details" with Gutenberg plugin 19.5.0). According to block API reference: "Setting parent lets a block require that it is only available when nested within the specified blocks."
Step-by-step reproduction instructions
Set a custom block's parent metadata key to a specific parent block:
{ "parent": [ "core/cover" ] }
In the editor, create the cover block and insert your custom block. While selecting your custom block, click on the button that has the blocks icon in the floating toolbar to get the transform options. There are seen buttons: "Columns" and "Group" (and "Details" with Gutenberg plugin 19.5.0). When user clicks either of them, the custom block is now wrapped within the corresponding block, bypassing the restriction set by the parent block API.
Screenshots, screen recording, code snippet
No response
Environment info
Tested on WP 6.6.2 without Gutenberg plugin as well as with Gutenberg plugin 19.5.0.
Please confirm that you have searched existing issues in the repo.
[x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
[x] Yes
Please confirm which theme type you used for testing.
Description
The
parent
block API is not being honored by the transform options "Columns" and "Group" (and "Details" with Gutenberg plugin 19.5.0). According to block API reference: "Setting parent lets a block require that it is only available when nested within the specified blocks."Step-by-step reproduction instructions
Set a custom block's
parent
metadata key to a specific parent block:{ "parent": [ "core/cover" ] }
In the editor, create the cover block and insert your custom block. While selecting your custom block, click on the button that has the blocks icon in the floating toolbar to get the transform options. There are seen buttons: "Columns" and "Group" (and "Details" with Gutenberg plugin 19.5.0). When user clicks either of them, the custom block is now wrapped within the corresponding block, bypassing the restriction set by the
parent
block API.Screenshots, screen recording, code snippet
No response
Environment info
Tested on WP 6.6.2 without Gutenberg plugin as well as with Gutenberg plugin 19.5.0.
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.