Support

Account

Home Forums Bug Reports No content after inner blocks

Unread

No content after inner blocks

  • Hi,

    the following code is producing strange – probably faulty – results. I tried to strip the callback as much as possible and put it into a anonymus function. Also this is tested with the twentytwentytwo theme and no plugins active – besides acf pro of course:

    function acf_register_acf_test_block_type() {
    	acf_register_block_type( array(
    		'name'            => 'acf-test',
    		'title'           => __( 'acf-test' ),
    		'render_callback' => function(){echo 'before - <InnerBlocks /> - after';},
    		'category'        => 'ACF TEST',
    		'mode'            => 'preview',
    		'supports'        => array(
    			'align' => false,
    			'mode'  => true,
    			'jsx'   => true
    		)
    	) );
    }
    
    // Check if function exists and hook into setup.
    if ( function_exists( 'acf_register_acf_test_block_type' ) ) {
    	add_action( 'acf/init', 'acf_register_acf_test_block_type' );
    }
    

    In the frontend the output is as expected: before – WHATEVER WAS INSERTED AS INNER BLOCK – after. In the editor however, anything after <InnerBlocks /> isn’t displayed.

    Am I missing something here?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.