forked from roryee/artificial-intelligence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions-acf.php
338 lines (337 loc) · 7.64 KB
/
functions-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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<?php
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_block',
'title' => 'Block',
'fields' => array (
array (
'key' => 'field_54dfed04b9239',
'label' => 'Layout',
'name' => 'layout',
'type' => 'radio',
'instructions' => 'Choose the layout of this block. Thumbnail is laid out as a background image spread out with a caption at the bottom. Overlay places text on top of the featured image. Solid is laid out horizontally on a solid background.',
'required' => 1,
'choices' => array (
'thumbnail' => 'Thumbnail',
'overlay' => 'Overlay',
'solid' => 'Solid',
),
'other_choice' => 0,
'save_other_choice' => 0,
'default_value' => 'thumbnail',
'layout' => 'vertical',
),
array (
'key' => 'field_54dec16354b3a',
'label' => 'Heading',
'name' => 'heading',
'type' => 'text',
'instructions' => 'The heading to use in the slide.',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_54dfed4db923a',
'label' => 'Heading 2',
'name' => 'heading_2',
'type' => 'text',
'instructions' => 'Add a secondary heading. Only supported for overlay.',
'conditional_logic' => array (
'status' => 1,
'rules' => array (
array (
'field' => 'field_54dfed04b9239',
'operator' => '==',
'value' => 'overlay',
),
),
'allorany' => 'all',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
array (
'key' => 'field_54dec16854b3b',
'label' => 'Content',
'name' => 'content',
'type' => 'textarea',
'instructions' => 'The content that will appear in the slide\'s footer.',
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'formatting' => 'br',
),
array (
'key' => 'field_54dec16d54b3c',
'label' => 'Link',
'name' => 'link',
'type' => 'page_link',
'instructions' => 'Where do you want this slide\'s link to take you?',
'post_type' => array (
0 => 'all',
),
'allow_null' => 0,
'multiple' => 0,
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'slides',
'order_no' => 0,
'group_no' => 0,
),
),
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'showcases',
'order_no' => 0,
'group_no' => 1,
),
),
),
'options' => array (
'position' => 'acf_after_title',
'layout' => 'no_box',
'hide_on_screen' => array (
0 => 'permalink',
1 => 'the_content',
2 => 'excerpt',
3 => 'custom_fields',
4 => 'discussion',
5 => 'comments',
6 => 'slug',
7 => 'format',
8 => 'categories',
9 => 'tags',
10 => 'send-trackbacks',
),
),
'menu_order' => 100,
));
register_field_group(array (
'id' => 'acf_slides',
'title' => 'Slides',
'fields' => array (
array (
'key' => 'field_54dec49dfe827',
'label' => 'Position',
'name' => 'position',
'type' => 'radio',
'choices' => array (
'slider' => 'Slider',
'whole' => 'Below Slider',
),
'other_choice' => 0,
'save_other_choice' => 0,
'default_value' => 'whole',
'layout' => 'vertical',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'slides',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'acf_after_title',
'layout' => 'no_box',
'hide_on_screen' => array (
0 => 'permalink',
1 => 'the_content',
2 => 'excerpt',
3 => 'custom_fields',
4 => 'discussion',
5 => 'comments',
6 => 'revisions',
7 => 'slug',
8 => 'format',
9 => 'categories',
10 => 'tags',
11 => 'send-trackbacks',
),
),
'menu_order' => 200,
));
register_field_group(array (
'id' => 'acf_showcase-blocks',
'title' => 'Showcase Blocks',
'fields' => array (
array (
'key' => 'field_54dec415f4283',
'label' => 'Show on Page',
'name' => 'show',
'type' => 'relationship',
'instructions' => 'Which page this part should be displayed on. The chosen page must be be a showcase page. Parts are displayed in the order assigned to them via the "Order" option, from smallest to largest.',
'return_format' => 'id',
'post_type' => array (
0 => 'page',
),
'taxonomy' => array (
0 => 'all',
),
'filters' => array (
0 => 'search',
),
'result_elements' => array (
0 => 'post_type',
1 => 'post_title',
),
'max' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'showcases',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'acf_after_title',
'layout' => 'no_box',
'hide_on_screen' => array (
0 => 'permalink',
1 => 'the_content',
2 => 'excerpt',
3 => 'custom_fields',
4 => 'discussion',
5 => 'comments',
6 => 'revisions',
7 => 'slug',
8 => 'format',
9 => 'categories',
10 => 'tags',
11 => 'send-trackbacks',
),
),
'menu_order' => 800,
));
register_field_group(array (
'id' => 'acf_showcase-pages',
'title' => 'Showcase Pages',
'fields' => array (
array (
'key' => 'field_54dec37ebd895',
'label' => 'Menu',
'name' => 'nav_menu',
'type' => 'text',
'instructions' => 'Enter the name of the navigation menu you want to display for this showcase page. You can access your navigation menus through Appearance > Menus.',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'html',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'page_template',
'operator' => '==',
'value' => 'showcase.php',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'acf_after_title',
'layout' => 'no_box',
'hide_on_screen' => array (
0 => 'permalink',
1 => 'the_content',
2 => 'excerpt',
3 => 'custom_fields',
4 => 'discussion',
5 => 'comments',
6 => 'revisions',
7 => 'slug',
8 => 'format',
9 => 'categories',
10 => 'tags',
11 => 'send-trackbacks',
),
),
'menu_order' => 900,
));
register_field_group(array (
'id' => 'acf_fade-in',
'title' => 'Fade In',
'fields' => array (
array (
'key' => 'field_54dec30c32909',
'label' => 'Fade In',
'name' => 'fade_in',
'type' => 'true_false',
'instructions' => 'Whether the first slide or block on the page should fade into view.',
'message' => '',
'default_value' => 0,
),
),
'location' => array (
array (
array (
'param' => 'page_type',
'operator' => '==',
'value' => 'front_page',
'order_no' => 0,
'group_no' => 0,
),
),
array (
array (
'param' => 'page_template',
'operator' => '==',
'value' => 'showcase.php',
'order_no' => 0,
'group_no' => 1,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
0 => 'permalink',
1 => 'the_content',
2 => 'excerpt',
3 => 'custom_fields',
4 => 'discussion',
5 => 'comments',
6 => 'revisions',
7 => 'slug',
8 => 'format',
9 => 'categories',
10 => 'tags',
11 => 'send-trackbacks',
),
),
'menu_order' => 1000,
));
}