blocks.php 603 Bytes
<?php

add_action('acf/init', 'my_acf_init_block_types');
function my_acf_init_block_types() {
    
    // Check function exists.
    if( function_exists('acf_register_block_type') ) {

        acf_register_block_type( array(
            'title'			=> __( 'Events Block', 'client_textdomain' ),
            'name'			=> 'events_block',
            'render_template'	=> 'blocks/events/events.php',
            'mode'			=> 'edit',
            'supports'		=> [
                'align'			=> false,
                'anchor'		=> true,
                'customClassName'	=> true
            ]
        ));

    }
}