Restrict Block Types – Pattern Library

Hi there,
I am trying to improve our customers backend. Therefor I want to restrict the blocks so that they can only insert the necessary blocks and also the pattern library.

The restriction of the blocks work like a charm, but I am not sure how to add the pattern library to the whitelist. Do you have any idea?

if (current_user_can( 'editor' )){
  function bwk_whitelist_blocks() {
    return array(
      'generateblocks/container',
      'generateblocks/headline',
      'generateblocks/button',
      'generateblocks/grid',
      'generateblocks/image',
      'generateblocks/pattern',
    );
  }
  add_filter('allowed_block_types_all','bwk_whitelist_blocks');
}

Thanks in advance guys :slight_smile:
Dominik

Hi @dominik,

Try 'generateblocks/template-library'

Hi @fernandoazarcon2
thanks – that’s it! :+1:

You’re welcome @dominik!