MWDelaney / sage-acf-wp-blocks

Composer library for generating ACF Gutenberg blocks from templates. Intended for use with Roots/Sage (http://roots.io)
347 stars 65 forks source link

Hide default blocks #41

Closed basvandertogt closed 3 years ago

basvandertogt commented 4 years ago

What is a proper way to hide the default Gutenberg Blocks in combination with this plugin?

nik-a73 commented 3 years ago

You can allow blocks with this hook:

add_filter( 'allowed_block_types', 'AllowBlockTypes' );

function AllowBlockTypes($allowed_blocks)   {
        return [
            'core/image',
            'core/video',
            'core/paragraph',
            'core/heading',
            'core/list',
            'acf/custom-block', // custom-block is block file name ( i.e custom-block.blade.php)
        ];
}
basvandertogt commented 3 years ago

Tnx!