Support

Account

Home Forums Gutenberg ACF Blocks won't render when using register_block_template() Reply To: ACF Blocks won't render when using register_block_template()

  • I’m sorry, but i’ve the same trouble i can’t find a way to solve it : always get a white page

    
    acf_register_block_type(array(
                'name'              => 'csm',
                'title'             => __('Centre de soins'),
                'description'       => __(''),
                'render_callback'   => 'acf_csm_block',
                'supports'          => array( 'align' =>false ),
                'post_types'        => array('post', 'page'),
                'mode'              => 'edit',
                'category'          => 'cnesoa',
                'icon'              => 'plus'
            ));
    function register_block_template() {
    
        //Posts
        $post_type_object_post = get_post_type_object( 'post' );
        $post_type_object_post->template = array(
            array( 'acf/csm' ),
        );
    }
    add_action( 'init', 'register_block_template' );

    What i’m doing wrong ?

    thank you