Hi,
I wanted my block to be registered in the core “layout” category. According to the documentation, the function seem to wait for a parameter called “category” like in the wordpress register block function :
add_action('acf/init', 'rt_block_section');
function rt_block_section() {
if( function_exists('acf_register_block') ) {
acf_register_block(array(
'title' => __( 'Section', 'rt' ),
'name' => 'section',
'category' => 'layout',
'keywords' => array( 'section' ),
'mode' => 'preview',
'render_template' => 'template-parts/blocks/section.php',
'supports' => [
'align' => false,
'anchor' => true,
'customClassName' => true,
'jsx' => true,
],
));
}
}
However my block remains displayed in the “text” category, and not in the “layout” category.
First I though it was a problem due to cache, so I cleared it manually, but it didn’t change anything. Any idea about how I can fix it ?
Thank you in advance.
Maybe it needs an array instead of a single cat name such as ['layout']
because I think you can add multiple like ['layout', 'custom']
.