Issue Overview
The blocks autocompleter (what you get when you type a /) doesn't respect the allowed_block_types filter.
Steps to Reproduce (for bugs)
- Add the following to the top of
lib/load.php:
add_filter( 'allowed_block_types', function() {
return [ 'core/paragraph', 'core/image', 'core/quote' ];
} );
- Create a post
- Press /
Expected Behavior
Only the Paragraph, Image and Quote bugs should appear in the dropdown.
Shared blocks should be properly filtered when using allowed_block_types filter.
Current Behavior
All blocks should appear in the dropdown.
If you limit the blocks which can be shown using the allowed_block_types filter then shared blocks do not appear in the 'Shared' block inserter tab.
Possible Solution
The getInserterItems selector will correctly filter out non-allowed blocks if you pass the editor setting as its second argument.
Screenshots / Video

Related Issues and/or PRs
#4225 #3791 — both of these would also be fixed by the above suggested solution.
Issue Overview
The blocks autocompleter (what you get when you type a /) doesn't respect the
allowed_block_typesfilter.Steps to Reproduce (for bugs)
lib/load.php:Expected Behavior
Only the Paragraph, Image and Quote bugs should appear in the dropdown.
Shared blocks should be properly filtered when using
allowed_block_typesfilter.Current Behavior
All blocks should appear in the dropdown.
If you limit the blocks which can be shown using the allowed_block_types filter then shared blocks do not appear in the 'Shared' block inserter tab.
Possible Solution
The
getInserterItemsselector will correctly filter out non-allowed blocks if you pass the editor setting as its second argument.Screenshots / Video
Related Issues and/or PRs
#4225 #3791 — both of these would also be fixed by the above suggested solution.