MB Blocks with allowed_block_types

Support MB Blocks MB Blocks with allowed_block_typesResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17702
    epacepac
    Participant

    Hi
    I use this function to remove some default block. Is there a way to add my custom blocks into the filtered list ? I've tried to add the id block, but it doesn't work.
    Many thanks

    function my_plugin_allowed_block_types( $allowed_block_types, $post ) {
    return array(
    'core/image',
    'core/paragraph',
    'core/heading',
    'core/list',
    'core/button',
    'core/video',
    'core/file',
    'core/button',
    'core/columns',
    );
    }

    add_filter( 'allowed_block_types', 'my_plugin_allowed_block_types', 10, 2 );

    #17714
    Anh TranAnh Tran
    Keymaster

    Hi,

    Each block registered with MB Blocks has an unique ID of meta-box/{$id}. So you can use it to add to your filter list.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.