Support

Account

Home Forums Gutenberg Innerblocks with core/group allowedBlocks not working

Unread

Innerblocks with core/group allowedBlocks not working

  • Hello I want to create a gutenberg block with ACF via Innerblocks when I use a core/group block the allowedBlocks function no longer works is this normal

    //code avec core/group le allowedBlocks ne fonctionne pas ?
    $allowed_blocks = array( 'core/paragraph', 'core/image', 'core/spacer' );
    
    $template = array(
    		array('core/group',array(
    			'className' => 'has-default-background-color'
    		), array(
    			array('core/heading', array(
    					'level' => 3,
    					'placeholder' => 'Ajouter votre titre',
    					'textColor' => 'white',
    				)),
    			array( 'core/paragraph', array(
    						'textColor' => 'white',
    						'placeholder' => 'Ajouter votre paragraphe',
    			))
    			))
    	
    );
    
    <div>
    <?php echo '<InnerBlocks allowedBlocks="' . esc_attr( wp_json_encode( $allowed_blocks ) ) . '" template="'.esc_attr(wp_json_encode($template)).'" />';?>
    </div>
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.