-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwidget-loader-acf.php
executable file
·98 lines (96 loc) · 3.92 KB
/
widget-loader-acf.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
$key = 'people_grid';
$widgetplacement = self::$config['tab_placement'];
$widget_config = [
'key' => $key,
'name' => 'people-grid',
'label' => 'People Grid',
'display' => 'block',
'sub_fields' => [
[
'key' => $key.'_basic_details_tab',
'label' => 'Basic Details',
'type' => 'tab',
'placement' => $widgetplacement,
],
[
'key' => $key.'_repeater',
'label' => 'People Grid',
'name' => 'people_grid',
'type' => 'repeater',
'min' => '1',
'layout' => 'block',
'button_label' => 'Add a person',
'sub_fields' => [
[
'key' => $key.'_image',
'label' => 'Image',
'name' => 'image',
'type' => 'image',
'return_format' => 'array',
'preview_size' => 'thumbnail',
'library' => 'all',
'wrapper' => [
'width' => '50%',
]
],
[
'key' => $key.'alternative_image',
'label' => 'Alternative Image',
'name' => 'alternative_image',
'type' => 'image',
'return_format' => 'array',
'preview_size' => 'thumbnail',
'library' => 'all',
'wrapper' => [
'width' => '50%',
]
],
[
'key' => $key.'_name',
'label' => 'Name',
'name' => 'name',
'type' => 'text',
'simplify' => 1,
'no_return' => 0,
'disable_toolbar' => 0
],
[
'key' => $key.'_job_title',
'label' => 'Job Title',
'name' => 'job_title',
'type' => 'text',
'simplify' => 1,
'no_return' => 0,
'disable_toolbar' => 0
],
[
'key' => $key.'_email',
'label' => 'Email',
'name' => 'email',
'type' => 'email'
],
[
'key' => $key.'_telephone',
'label' => 'Telephone',
'name' => 'telephone',
'type' => 'number'
],
[
'key' => $key.'_description',
'label' => 'Description',
'name' => 'description',
'type' => 'strict_wysiwyg'
]
]
],
[
'key' => $key.'_advanced_details_tab',
'label' => 'Advanced Details',
'type' => 'tab',
'placement' => $widgetplacement,
]
]
];
$widget_config["content-types"] = get_option("options_" . $key . "_available_post_types");
$widget_config["content-sizes"] = array('main', 'main-full-bleed'); // main, main-full-bleed, sidebar