Support

Account

Home Forums Gutenberg Get a list of all acf blocks (to add it to wordpress allowed_block_types)

Unread

Get a list of all acf blocks (to add it to wordpress allowed_block_types)

  • To disable specific wordpress core blocks I need to come from the other side and allow the ones I want. Everything fine so far, but now I also need to add all acf blocks to this whitelist. Still ok, but as I add and remove blocks frequently, it would be way smoother, if this could be done automatically.

    Is there a possibility to get a list of the names of all registered acf blocks to add them to allowed_block_types?

    $allowed_blocks = array(
       'core/paragraph',
       'core/image',
       'core/heading',
    //and now the acf blocks, that I want to add automatically
       'acf/my-block-1',
       'acf/my-block-2',
    );

    Thanks for any idea,
    Piiit

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.