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.
Closing in favor of #6070 which is duplicate but with a much detailed description. I consolidated those 2 into one :)
I don't think it's a dupe. #5893 is referring to shared blocks not appearing in the inserter when allowed_block_types is set to false, whereas #6070 is referring to _all blocks_ mistakenly appearing in the / command regardless of what allowed_block_types is set to.
Having said that, @paulwilde: could you elaborate on this a little more? Reproduction steps would be useful for making sure that we're all on the same page here.
My first impression is that this is expected behaviour. If one adds this to their lib/load.php:
add_filter( 'allowed_block_types', function() {
return [ 'core/paragraph', 'core/image', 'core/quote' ];
} );
Then I would expect that shared blocks should not appear in any of the inserters, as we did not explicitly allow the core/block block type.
Conversely, if one adds this to their lib/load.php:
add_filter( 'allowed_block_types', function() {
return [ 'core/paragraph', 'core/image', 'core/quote', 'core/block' ];
} );
Then I would expect that shared blocks will appear in the various inserters.
Actually, this isn't a bug in that case. I didn't realise you had to add core/block for shared blocks to appear in the inserter. I figured that just whitelisting the block types would suffice for them to show up as shared blocks.
It might make sense for this fact to be added to the documentation to ease confusion. Also maybe the ability to create shared blocks should be disable if core/block isn't whitelisted?
I didn't realise you had to add core/block for shared blocks to appear in the inserter
I mean, that's just what _I_ think makes sense. Happy to be persuaded otherwise 馃槃
It might make sense for this fact to be added to the documentation to ease confusion. Also maybe the ability to create shared blocks should be disable if core/block isn't whitelisted?
馃憤 agreed.
Most helpful comment
Having said that, @paulwilde: could you elaborate on this a little more? Reproduction steps would be useful for making sure that we're all on the same page here.
My first impression is that this is expected behaviour. If one adds this to their
lib/load.php:Then I would expect that shared blocks should not appear in any of the inserters, as we did not explicitly allow the
core/blockblock type.Conversely, if one adds this to their
lib/load.php:Then I would expect that shared blocks will appear in the various inserters.