Enable Access to Specific Blocks

I am creating a snippet (see below) that will provide my clients to only certain blocks. GenerateBlocks will be among those. I can’t seem to display the Button block and I’m not sure why. Is there a list of the GenerateBlocks blocknames that I can refer to? Thanks much! -Mike

add_filter( 'allowed_block_types_all', 'ewu_allowed_block_types', 25, 2 );
 
function ewu_allowed_block_types( $allowed_blocks, $editor_context ) {
 
	return array(
		'core/image',
		'core/paragraph',
		'cover/file',
		'core/heading',
		'core/list',
		'core/columns',
		'core/gallery',
		'core/pullquote',
		'core/more',
		'core/pagebreak',
		'core/html',
		'kadence/accordion',
		'generateblocks/container',
		'generateblocks/grid',
		'generateblocks/image',
		'generateblocks/button',
		'generateblocks/buttons',
	);
 
}

Got it.

add_filter( 'allowed_block_types_all', 'ewu_allowed_block_types', 25, 2 );
 
function ewu_allowed_block_types( $allowed_blocks, $editor_context ) {
 
	return array(
		'core/image',
		'core/paragraph',
		'cover/file',
		'core/heading',
		'core/list',
		'core/columns',
		'core/gallery',
		'core/pullquote',
		'core/more',
		'core/pagebreak',
		'core/html',
		'core/block',
		'kadence/accordion',
		'generateblocks/container',
		'generateblocks/grid',
		'generateblocks/image',
		'generateblocks/button-container',
		'generateblocks/button',
	);
 
}
1 Like