Support » Plugin: Gutenberg » Allow core Gutenberg blocks selection only when you are inside a custom block

  • By adding a new post, we have access to all core blocks from the very beginning. I would like to limit this and prevent some core blocks from being used on the main level. They should only be available inside my custom inner block.

    I figured maybe hiding blocks, depending on where the inserter is in the DOM structure might be an idea but I’m not sure it’s a good direction.

    So how to allow core Gutenberg blocks selection only when you are inside a custom inner block

Viewing 1 replies (of 1 total)
  • You can control the blocks that are allowed in the inspector using allowed_block_types()

    You can specify what blocks are allowed inside your custom block using the ALLOWED_BLOCKS property.

    However I am not too sure how both of these will work combined together, allowed_block_types may override ALLOWED_BLOCKS and prevent event the allowed blocks from displaying.

Viewing 1 replies (of 1 total)
  • The topic ‘Allow core Gutenberg blocks selection only when you are inside a custom block’ is closed to new replies.