-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample-functions.php
67 lines (63 loc) · 1.88 KB
/
example-functions.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
defined('ABSPATH') or die();
if( defined('CMB2_LOADED') ) {
require_once('cmb2-theme-options-tabs/cmb-theme-options-tabs.php');
}
function cmb2_ld_theme_options_fields()
{
$fields = array(
array(
'name' => 'General options',
'id' => '_ld_main_general_box_title',
'type' => 'title',
'show_in_tab' => 'en' // Tab slug
),
array(
'name' => 'Facebook URL',
'id' => '_ld_general_facebook_url',
'type' => 'text_url',
'show_in_tab' => 'en' // Tab slug
),
array(
'name' => '404 page settings',
'id' => '_ld_main_404_box_title',
'type' => 'title'
),
array(
'name' => 'Title',
'id' => '_ld_main_404_title',
'type' => 'text'
),
array(
'name' => 'Content',
'id' => '_ld_main_404_content',
'type' => 'wysiwyg',
'options' => array(
'textarea_rows' => 5
)
),
array(
'id' => '_ld_main_group_example',
'type' => 'group',
'options' => array(
'group_title' => 'Entry {#}',
'add_button' => 'Add Another Entry',
'remove_button' => 'Remove Entry'
),
'fields' => array(
array(
'name' => 'Entry Title',
'id' => 'title',
'type' => 'text',
),
array(
'name' => 'Entry Image',
'id' => 'image',
'type' => 'file'
)
)
)
);
return $fields;
}
add_filter('cmb2_theme_options_tab_fields', 'cmb2_ld_theme_options_fields');