blocks.php
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
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' => __( 'Carousel', 'client_textdomain' ),
'name' => 'carousel',
'render_template' => 'blocks/carousel/carousel.php',
'mode' => 'edit',
'supports' => [
'align' => false,
'anchor' => true,
'customClassName' => true
]
));
acf_register_block_type( array(
'title' => __( 'Link Blocks', 'client_textdomain' ),
'name' => 'link-block',
'render_template' => 'blocks/link-block/link-block.php',
'mode' => 'edit',
'supports' => [
'align' => false,
'anchor' => true,
'customClassName' => true
]
));
}
}
if( function_exists('acf_add_options_page') ) {
acf_add_options_page(array(
'page_title' => 'Department/Branch Settings',
'menu_title' => 'Department/Branch',
'menu_slug' => 'department-branch-settings',
'capability' => 'edit_posts',
'redirect' => false
));
}