Support

Account

Home Forums Gutenberg Add custom inner blocks to restricted block

Helping

Add custom inner blocks to restricted block

  • I can’t see an explanation anywhere of how to add custom blocks as inner blocks to a restricted block.

    In the documentation, the example shows this:

    $allowed_blocks = array( 'core/image', 'core/paragraph' );
    echo '<InnerBlocks allowedBlocks="' . esc_attr( wp_json_encode( $allowed_blocks ) ) . '" />';

    I have created a custom block in:

    my-theme-folder/template-parts/blocks/custom/custom.php

    I would like to add this to a restricted block. How do I do this?

    Thanks!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.