Issue Overview
If you define a list of "allowed_blocks" via this filter: https://github.com/WordPress/gutenberg/blob/a1055928b76718dc363be410ad6b2f00ff367c2c/docs/extensibility/extending-blocks.md#hiding-blocks-from-the-inserter
The blocks are filtered out of the inserter, but the "Transform Into" option allows you to transform into any block still.
I think the expectation would be for the transform into option to also respect just the allowed blocks.
Steps to Reproduce (for bugs)
- Use the filter
allowed_block_types to just filter support for a single block type:
add_filter( 'allowed_block_types', function( $allowed_block_types, $post ) {
return [ 'core/paragraph' ];
}, 10, 2 );
- Add a paragraph block
- Click "More Options" on the block
- See other "non-allowed" blocks you can transform into
Expected Behavior
- Use the filter
allowed_block_types to just filter support for a single block type:
add_filter( 'allowed_block_types', function( $allowed_block_types, $post ) {
return [ 'core/paragraph' ];
}, 10, 2 );
- Add a paragraph block
- Click "More Options" on the block
- Only see blocks that are "allowed", if any
Todos
Issue Overview
If you define a list of "allowed_blocks" via this filter: https://github.com/WordPress/gutenberg/blob/a1055928b76718dc363be410ad6b2f00ff367c2c/docs/extensibility/extending-blocks.md#hiding-blocks-from-the-inserter
The blocks are filtered out of the inserter, but the "Transform Into" option allows you to transform into any block still.
I think the expectation would be for the
transform intooption to also respect just the allowed blocks.Steps to Reproduce (for bugs)
allowed_block_typesto just filter support for a single block type:Expected Behavior
allowed_block_typesto just filter support for a single block type:Todos