PluginProbe ʕ •ᴥ•ʔ
Advanced Custom Fields: Extended / 0.9.2.7
Advanced Custom Fields: Extended v0.9.2.7
0.9.2.7 0.9.2.6 0.9.2.5 0.8.6 0.8.6.1 0.8.6.3 0.8.6.5 0.8.6.6 0.8.6.7 0.8.6.8 0.8.6.9 0.8.7 0.8.7.1 0.8.7.2 0.8.7.3 0.8.7.4 0.8.7.5 0.8.7.6 0.8.8 0.8.8.1 0.8.8.10 0.8.8.11 0.8.8.2 0.8.8.3 0.8.8.4 0.8.8.5 0.8.8.6 0.8.8.7 0.8.8.8 0.8.8.9 0.8.9 0.8.9.1 0.8.9.2 0.8.9.3 0.8.9.4 0.8.9.5 0.9 0.9.0.1 0.9.0.2 0.9.0.3 0.9.0.4 0.9.0.5 0.9.0.6 0.9.0.7 0.9.0.8 0.9.0.9 0.9.1 0.9.1.1 0.9.2 0.9.2.1 0.9.2.2 0.9.2.3 0.9.2.4 trunk 0.5 0.5.1 0.5.2 0.5.2.1 0.5.2.3 0.5.5 0.5.5.1 0.5.8 0.5.8.1 0.6 0.6.0.1 0.6.0.2 0.6.1 0.6.3 0.6.5 0.6.7 0.6.7.2 0.7 0.7.0.3 0.7.5 0.7.5.5 0.7.8 0.7.9 0.7.9.3 0.7.9.4 0.7.9.9.8 0.7.9.9.9 0.8 0.8.1 0.8.2 0.8.3 0.8.3.1 0.8.4 0.8.4.1 0.8.4.5 0.8.4.6 0.8.5 0.8.5.5
acf-extended / includes / modules / form / module-form-upgrades.php
acf-extended / includes / modules / form Last commit date
module-form-action-custom.php 9 months ago module-form-action-email.php 1 week ago module-form-action-post.php 3 months ago module-form-action-redirect.php 9 months ago module-form-action-term.php 3 months ago module-form-action-user.php 1 week ago module-form-action.php 3 months ago module-form-compatibility.php 3 months ago module-form-deprecated.php 1 year ago module-form-fields.php 3 months ago module-form-front-hooks.php 3 months ago module-form-front-render.php 1 week ago module-form-front.php 3 months ago module-form-shortcode.php 1 week ago module-form-upgrades.php 3 months ago module-form.php 3 months ago
module-form-upgrades.php
6779 lines
1 <?php
2
3 if(!defined('ABSPATH')){
4 exit;
5 }
6
7 if(!class_exists('acfe_module_form_upgrades')):
8
9 class acfe_module_form_upgrades{
10
11 function __construct(){
12
13 // upgrade
14 add_action('acfe/do_upgrade', array($this, 'upgrade_0_9_0_1'), 40);
15 add_action('acfe/do_upgrade', array($this, 'upgrade_0_9'), 30);
16 add_action('acfe/do_upgrade', array($this, 'upgrade_0_8_8'), 20);
17 add_action('acfe/do_upgrade', array($this, 'upgrade_0_8_5'), 10);
18
19 }
20
21 /**
22 * upgrade_0_9_0_1
23 *
24 * acfe/do_upgrade:40
25 *
26 * @param $db_version
27 */
28 function upgrade_0_9_0_1($db_version){
29
30 // check already done
31 if(acf_version_compare($db_version, '>=', '0.9.0.1')){
32 return;
33 }
34
35 // re-run 0.9 upgrade
36 $this->upgrade_0_9('0.8.9.5');
37
38 }
39
40 /**
41 * upgrade_0_9
42 *
43 * acfe/do_upgrade:30
44 *
45 * @param $db_version
46 */
47 function upgrade_0_9($db_version){
48
49 // check already done
50 if(acf_version_compare($db_version, '>=', '0.9')){
51 return;
52 }
53
54 // get forms posts
55 $forms = get_posts(array(
56 'post_type' => 'acfe-form',
57 'posts_per_page' => -1,
58 'fields' => 'ids',
59 'post_status' => 'any',
60 ));
61
62 $todo = array();
63
64 foreach($forms as $post_id){
65
66 // validate old item
67 if(acfe_is_module_v2_item($post_id)){
68 $todo[] = $post_id;
69 }
70
71 }
72
73 // bail early
74 if(!$todo){
75 return;
76 }
77
78 // add legacy form field group
79 $this->add_v2_field_group();
80
81 // get module
82 $module = acfe_get_module('form');
83
84 // loop
85 foreach($todo as $post_id){
86
87 // get meta values
88 $meta = get_fields($post_id, false);
89
90 // default item
91 $item = array(
92 'ID' => $post_id,
93 'name' => get_field('acfe_form_name', $post_id),
94 'label' => get_post_field('post_title', $post_id),
95 'title' => get_post_field('post_title', $post_id),
96 );
97
98 // upgrade item
99 $item = $this->upgrade_v2_item_to_v3($item, $meta);
100
101 // allow button html in post_content
102 remove_filter('content_save_pre', 'wp_filter_post_kses');
103
104 // import item (update db)
105 $module->import_item($item);
106
107 }
108
109 // remove legacy form field group
110 $this->remove_v2_field_group();
111
112 // log
113 acf_log('[ACF Extended] 0.9 Upgrade: Forms');
114
115 }
116
117
118 /**
119 * upgrade_0_8_8
120 *
121 * acfe/do_upgrade:20
122 *
123 * @param $db_version
124 */
125 function upgrade_0_8_8($db_version){
126
127 // check already done
128 if(acf_version_compare($db_version, '>=', '0.8.8')){
129 return;
130 }
131
132 acfe_delete_settings('modules.dynamic_form');
133
134 }
135
136
137 /**
138 * upgrade_0_8_5
139 *
140 * acfe/do_upgrade:10
141 *
142 * @param $db_version
143 */
144 function upgrade_0_8_5($db_version){
145
146 // check already done
147 if(acf_version_compare($db_version, '>=', '0.8.5')){
148 return;
149 }
150
151 // Retrieve all forms posts
152 $get_forms = get_posts(array(
153 'post_type' => 'acfe-form',
154 'posts_per_page' => -1,
155 'fields' => 'ids',
156 'post_status' => 'any'
157 ));
158
159 // Bail early if no form found
160 if(empty($get_forms)){
161 return;
162 }
163
164 $flexible = acf_get_field_type('flexible_content');
165 $field = acf_get_field('acfe_form_actions');
166
167 global $wpdb;
168
169 foreach($get_forms as $post_id){
170
171 // init
172 $wp_meta = array();
173 $acf_meta = array();
174
175 // Retrieve meta
176 $get_meta = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d ", $post_id));
177
178 // Sort
179 usort($get_meta, function($a, $b){
180 return strcmp($a->meta_key, $b->meta_key);
181 });
182
183 // Store
184 foreach($get_meta as $meta){
185 $wp_meta[ $meta->meta_key ] = $meta->meta_value;
186 }
187
188 // Check if is acf meta
189 foreach($wp_meta as $key => $value){
190
191 // ACF Meta
192 if(isset($wp_meta["_$key"])){
193
194 $acf_meta[] = array(
195 'key' => $key,
196 'value' => $wp_meta[$key],
197 );
198
199 }
200
201 }
202
203 /*
204 * Step 1: Upgrade old group fields
205 */
206 $prefix = 'acfe_form_actions';
207
208 // Define script rules
209 $rules = array(
210
211 // Post: title
212 array(
213 'group' => 'acfe_form_post_save_post_title_group',
214 'sub_field' => 'acfe_form_post_save_post_title_group_acfe_form_post_save_post_title',
215 'sub_field_custom' => 'acfe_form_post_save_post_title_group_acfe_form_post_save_post_title_custom',
216 'new_field' => 'acfe_form_post_save_post_title',
217 ),
218
219 // Post: name
220 array(
221 'group' => 'acfe_form_post_save_post_name_group',
222 'sub_field' => 'acfe_form_post_save_post_name_group_acfe_form_post_save_post_name',
223 'sub_field_custom' => 'acfe_form_post_save_post_name_group_acfe_form_post_save_post_name_custom',
224 'new_field' => 'acfe_form_post_save_post_name',
225 ),
226
227 // Term: name
228 array(
229 'group' => 'acfe_form_term_save_name_group',
230 'sub_field' => 'acfe_form_term_save_name_group_acfe_form_term_save_name',
231 'sub_field_custom' => 'acfe_form_term_save_name_group_acfe_form_term_save_name_custom',
232 'new_field' => 'acfe_form_term_save_name',
233 ),
234
235 // Term: slug
236 array(
237 'group' => 'acfe_form_term_save_slug_group',
238 'sub_field' => 'acfe_form_term_save_slug_group_acfe_form_term_save_slug',
239 'sub_field_custom' => 'acfe_form_term_save_slug_group_acfe_form_term_save_slug_custom',
240 'new_field' => 'acfe_form_term_save_slug',
241 ),
242
243 // User: e-mail
244 array(
245 'group' => 'acfe_form_user_save_email_group',
246 'sub_field' => 'acfe_form_user_save_email_group_acfe_form_user_save_email',
247 'sub_field_custom' => 'acfe_form_user_save_email_group_acfe_form_user_save_email_custom',
248 'new_field' => 'acfe_form_user_save_email',
249 ),
250
251 // User: username
252 array(
253 'group' => 'acfe_form_user_save_username_group',
254 'sub_field' => 'acfe_form_user_save_username_group_acfe_form_user_save_username',
255 'sub_field_custom' => 'acfe_form_user_save_username_group_acfe_form_user_save_username_custom',
256 'new_field' => 'acfe_form_user_save_username',
257 ),
258
259 // User: password
260 array(
261 'group' => 'acfe_form_user_save_password_group',
262 'sub_field' => 'acfe_form_user_save_password_group_acfe_form_user_save_password',
263 'sub_field_custom' => 'acfe_form_user_save_password_group_acfe_form_user_save_password_custom',
264 'new_field' => 'acfe_form_user_save_password',
265 ),
266
267 // User: first name
268 array(
269 'group' => 'acfe_form_user_save_first_name_group',
270 'sub_field' => 'acfe_form_user_save_first_name_group_acfe_form_user_save_first_name',
271 'sub_field_custom' => 'acfe_form_user_save_first_name_group_acfe_form_user_save_first_name_custom',
272 'new_field' => 'acfe_form_user_save_first_name',
273 ),
274
275 // User: last name
276 array(
277 'group' => 'acfe_form_user_save_last_name_group',
278 'sub_field' => 'acfe_form_user_save_last_name_group_acfe_form_user_save_last_name',
279 'sub_field_custom' => 'acfe_form_user_save_last_name_group_acfe_form_user_save_last_name_custom',
280 'new_field' => 'acfe_form_user_save_last_name',
281 ),
282
283 // User: nickname
284 array(
285 'group' => 'acfe_form_user_save_nickname_group',
286 'sub_field' => 'acfe_form_user_save_nickname_group_acfe_form_user_save_nickname',
287 'sub_field_custom' => 'acfe_form_user_save_nickname_group_acfe_form_user_save_nickname_custom',
288 'new_field' => 'acfe_form_user_save_nickname',
289 ),
290
291 // User: display name
292 array(
293 'group' => 'acfe_form_user_save_display_name_group',
294 'sub_field' => 'acfe_form_user_save_display_name_group_acfe_form_user_save_display_name',
295 'sub_field_custom' => 'acfe_form_user_save_display_name_group_acfe_form_user_save_display_name_custom',
296 'new_field' => 'acfe_form_user_save_display_name',
297 ),
298
299 // User: website
300 array(
301 'group' => 'acfe_form_user_save_website_group',
302 'sub_field' => 'acfe_form_user_save_website_group_acfe_form_user_save_website',
303 'sub_field_custom' => 'acfe_form_user_save_website_group_acfe_form_user_save_website_custom',
304 'new_field' => 'acfe_form_user_save_website',
305 ),
306
307 );
308
309 // Process rules
310 foreach($rules as $rule){
311
312 $updates = array();
313
314 foreach($acf_meta as $acf){
315
316 // Bail early if doesn't starts with 'acfe_form_actions'
317 if(strpos($acf['key'], $prefix) !== 0){
318 continue;
319 }
320
321 // Regex: 'acfe_form_actions_2_acfe_form_post_save_post_title_group'
322 // Match: '2'
323 if(preg_match('/^' . $prefix . '_([0-9]+)_' . $rule['group'] . '$/', $acf['key'], $match)){
324
325 $updates[$rule['new_field']][$match[1]]['group'] = array(
326 'key' => $acf['key'],
327 'value' => $acf['value'],
328 );
329
330 // Regex: 'acfe_form_post_2_save_post_title_group_acfe_form_post_save_post_title'
331 // Match: '2'
332 }elseif(preg_match('/^' . $prefix . '_([0-9]+)_' . $rule['sub_field'] . '$/', $acf['key'], $match)){
333
334 $updates[$rule['new_field']][$match[1]]['sub_field'] = array(
335 'key' => $acf['key'],
336 'value' => $acf['value'],
337 );
338
339 // Regex: 'acfe_form_post_2_save_post_title_group_acfe_form_post_save_post_title_custom'
340 // Match: '2'
341 }elseif(preg_match('/^' . $prefix . '_([0-9]+)_' . $rule['sub_field_custom'] . '$/', $acf['key'], $match)){
342
343 // Generate: array[acfe_form_post_save_post_title][2]['sub_field_custom']
344 $updates[$rule['new_field']][$match[1]]['sub_field_custom'] = array(
345 'key' => $acf['key'],
346 'value' => $acf['value'],
347 );
348
349 }
350
351 }
352
353 if(!empty($updates)){
354
355 acf_log('[ACF Extended] 0.8.5 Upgrade: Forms');
356
357 // Update meta
358 foreach($updates as $new_field => $data){
359
360 foreach($data as $i => $row){
361
362 $group = acfe_get($row, 'group');
363 $sub_field = acfe_get($row, 'sub_field');
364 $sub_field_custom = acfe_get($row, 'sub_field_custom');
365
366 if($sub_field){
367
368 $new_field_name = "{$prefix}_{$i}_{$new_field}";
369
370 // update field
371 if($sub_field['value'] === 'custom'){
372
373 update_post_meta($post_id, $new_field_name, $sub_field_custom['value']);
374
375 }else{
376
377 update_post_meta($post_id, $new_field_name, $sub_field['value']);
378
379 }
380
381 // update reference
382 update_post_meta($post_id, '_' . $new_field_name, 'field_' . $new_field);
383
384 }
385
386 // Delete old group
387 delete_post_meta($post_id, $group['key']);
388 delete_post_meta($post_id, $sub_field['key']);
389 delete_post_meta($post_id, $sub_field_custom['key']);
390
391 }
392
393 }
394
395 }
396
397 }
398
399 /*
400 * Step 2: Upgrade map fields which now require "Load values" to be enabled
401 */
402 if(have_rows('acfe_form_actions', $post_id)):
403 while(have_rows('acfe_form_actions', $post_id)): the_row();
404
405 $layout = get_row_layout();
406 $row = get_row_index();
407 $i = $row-1;
408
409 // Post Action
410 if($layout === 'post'){
411
412 $load_values = get_sub_field('acfe_form_post_load_values');
413
414 $fields = array(
415 'field_acfe_form_post_save_post_type' => get_sub_field('acfe_form_post_map_post_type', false),
416 'field_acfe_form_post_save_post_status' => get_sub_field('acfe_form_post_map_post_status', false),
417 'field_acfe_form_post_save_post_title' => get_sub_field('acfe_form_post_map_post_title', false),
418 'field_acfe_form_post_save_post_name' => get_sub_field('acfe_form_post_map_post_name', false),
419 'field_acfe_form_post_save_post_content' => get_sub_field('acfe_form_post_map_post_content', false),
420 'field_acfe_form_post_save_post_author' => get_sub_field('acfe_form_post_map_post_author', false),
421 'field_acfe_form_post_save_post_parent' => get_sub_field('acfe_form_post_map_post_parent', false),
422 'field_acfe_form_post_save_post_terms' => get_sub_field('acfe_form_post_map_post_terms', false),
423 );
424
425 if(!$load_values){
426
427 foreach($fields as $field_key => $field_value){
428
429 // Bail early if map field has no value
430 if(empty($field_value)){
431 continue;
432 }
433
434 // args
435 $update = array();
436 $update['acf_fc_layout'] = $layout;
437
438 // Post content inside group
439 if($field_key === 'field_acfe_form_post_save_post_content'){
440
441 $update['field_acfe_form_post_save_post_content_group'] = array(
442 'field_acfe_form_post_save_post_content' => $field_value
443 );
444
445 }else{
446
447 $update[$field_key] = $field_value;
448
449 }
450
451 // update
452 $flexible->update_row($update, $i, $field, $post_id);
453
454 }
455
456 }
457
458 }
459
460 // Term Action
461 elseif($layout === 'term'){
462
463 $load_values = get_sub_field('acfe_form_term_load_values');
464
465 $fields = array(
466 'field_acfe_form_term_save_name' => get_sub_field('acfe_form_term_map_name', false),
467 'field_acfe_form_term_save_slug' => get_sub_field('acfe_form_term_map_slug', false),
468 'field_acfe_form_term_save_taxonomy' => get_sub_field('acfe_form_term_map_taxonomy', false),
469 'field_acfe_form_term_save_parent' => get_sub_field('acfe_form_term_map_parent', false),
470 'field_acfe_form_term_save_description' => get_sub_field('acfe_form_term_map_description', false),
471 );
472
473 if(!$load_values){
474
475 foreach($fields as $field_key => $field_value){
476
477 // Bail early if map field has no value
478 if(empty($field_value)){
479 continue;
480 }
481
482 // args
483 $update = array();
484 $update['acf_fc_layout'] = $layout;
485
486 // Post content inside group
487 if($field_key === 'field_acfe_form_term_save_description'){
488
489 $update['field_acfe_form_term_save_description_group'] = array(
490 'field_acfe_form_term_save_description' => $field_value
491 );
492
493 }else{
494
495 $update[$field_key] = $field_value;
496
497 }
498
499 // update
500 $flexible->update_row($update, $i, $field, $post_id);
501
502 }
503
504 }
505
506 }
507
508 // User Action
509 elseif($layout === 'user'){
510
511 $load_values = get_sub_field('acfe_form_user_load_values');
512
513 $fields = array(
514 'field_acfe_form_user_save_email' => get_sub_field('acfe_form_user_map_email', false),
515 'field_acfe_form_user_save_username' => get_sub_field('acfe_form_user_map_username', false),
516 'field_acfe_form_user_save_password' => get_sub_field('acfe_form_user_map_password', false),
517 'field_acfe_form_user_save_first_name' => get_sub_field('acfe_form_user_map_first_name', false),
518 'field_acfe_form_user_save_last_name' => get_sub_field('acfe_form_user_map_last_name', false),
519 'field_acfe_form_user_save_nickname' => get_sub_field('acfe_form_user_map_nickname', false),
520 'field_acfe_form_user_save_display_name' => get_sub_field('acfe_form_user_map_display_name', false),
521 'field_acfe_form_user_save_website' => get_sub_field('acfe_form_user_map_website', false),
522 'field_acfe_form_user_save_description' => get_sub_field('acfe_form_user_map_description', false),
523 'field_acfe_form_user_save_role' => get_sub_field('acfe_form_user_map_role', false),
524 );
525
526 if(!$load_values){
527
528 foreach($fields as $field_key => $field_value){
529
530 // Bail early if map field has no value
531 if(empty($field_value)){
532 continue;
533 }
534
535 // args
536 $update = array();
537 $update['acf_fc_layout'] = $layout;
538
539 // Post content inside group
540 if($field_key === 'field_acfe_form_user_save_description'){
541
542 $update['field_acfe_form_user_save_description_group'] = array(
543 'field_acfe_form_user_save_description' => $field_value
544 );
545
546 }else{
547
548 $update[$field_key] = $field_value;
549
550 }
551
552 // update
553 $flexible->update_row($update, $i, $field, $post_id);
554
555 }
556
557 }
558
559 }
560
561 endwhile;
562 endif;
563
564 }
565
566 }
567
568
569 /**
570 * upgrade_v2_item_to_v3
571 *
572 * ACF Extended: 0.9
573 *
574 * @param $item
575 * @param $args
576 *
577 * @return array
578 */
579 function upgrade_v2_item_to_v3($item, $args = array()){
580
581 // form attributes
582 $form_attributes = acfe_get($args, 'acfe_form_attributes');
583 $fields_attributes = acfe_get($args, 'acfe_form_fields_attributes');
584
585 // new item
586 $item = array(
587 'ID' => $item['ID'],
588 'name' => $item['name'],
589 'label' => $item['label'],
590 'title' => $item['title'],
591 'active' => acfe_get($args, 'acfe_form_active', true),
592 'field_groups' => acfe_get($args, 'acfe_form_field_groups'),
593 'settings' => array(
594 'location' => acfe_get($args, 'acfe_form_field_groups_rules'),
595 'honeypot' => acfe_get($args, 'acfe_form_honeypot'),
596 'kses' => acfe_get($args, 'acfe_form_kses'),
597 'uploader' => acfe_get($args, 'acfe_form_uploader'),
598 ),
599 'attributes' => array(
600 'form' => array(
601 'element' => acfe_get($args, 'acfe_form_form_element') ? 'form' : 'div',
602 'class' => acfe_get($form_attributes, 'field_acfe_form_attributes_class'),
603 'id' => acfe_get($form_attributes, 'field_acfe_form_attributes_id'),
604 ),
605 'fields' => array(
606 'element' => acfe_get($args, 'acfe_form_form_field_el'),
607 'wrapper_class' => acfe_get($fields_attributes, 'field_acfe_form_fields_wrapper_class'),
608 'class' => acfe_get($fields_attributes, 'field_acfe_form_fields_class'),
609 'label' => acfe_get($args, 'acfe_form_label_placement'),
610 'instruction' => acfe_get($args, 'acfe_form_instruction_placement'),
611 ),
612 'submit' => array(
613 'value' => acfe_get($args, 'acfe_form_submit_value'),
614 'button' => acfe_get($args, 'acfe_form_html_submit_button'),
615 'spinner' => acfe_get($args, 'acfe_form_html_submit_spinner'),
616 )
617 ),
618 'validation' => array(
619 'hide_error' => acfe_get($args, 'acfe_form_hide_error'),
620 'hide_revalidation' => acfe_get($args, 'acfe_form_hide_revalidation'),
621 'hide_unload' => acfe_get($args, 'acfe_form_hide_unload'),
622 'errors_position' => acfe_get($args, 'acfe_form_errors_position'),
623 'errors_class' => acfe_get($args, 'acfe_form_errors_class'),
624 ),
625 'success' => array(
626 'hide_form' => acfe_get($args, 'acfe_form_updated_hide_form'),
627 'message' => acfe_get($args, 'acfe_form_updated_message'),
628 'wrapper' => acfe_get($args, 'acfe_form_html_updated_message'),
629 ),
630 'actions' => array(),
631 'render' => '',
632 );
633
634 // submit disabled
635 if(!acfe_get($args, 'acfe_form_form_submit')){
636 $item['attributes']['submit'] = false;
637 }
638
639 // render
640 $render = '';
641 $old_render = acfe_get($args, 'acfe_form_custom_html');
642 $old_render_enabled = acfe_get($args, 'acfe_form_custom_html_enable');
643 $before_render = acfe_get($args, 'acfe_form_html_before_fields');
644 $after_render = acfe_get($args, 'acfe_form_html_after_fields');
645
646 // old render
647 if($old_render_enabled && $old_render){
648 $render = $old_render;
649 }
650
651 // generate render
652 if(!empty($before_render) || !empty($after_render)){
653
654 // empty render
655 // use {render:fields}
656 if(empty($render)){
657 $render = '{render:fields}';
658 }
659
660 // prepend before render
661 if(!empty($before_render)){
662 $render = $before_render . "\n\n" . $render;
663 }
664
665 // append before render
666 if(!empty($after_render)){
667 $render = $render . "\n\n" . $after_render;
668 }
669
670 }
671
672 // deprecated {field:field_625e53aa1a791}
673 // deprecated {field_group:group_61642cb824d8a}
674 $render = str_replace('{field:', '{render:', $render);
675 $render = str_replace('{field_group:', '{render:', $render);
676
677 // assign form render
678 $item['render'] = $render;
679
680 // loop actions
681 foreach(acfe_as_array($args['acfe_form_actions']) as $row){
682
683 switch($row['acf_fc_layout']){
684
685 /**
686 * custom
687 */
688 case 'custom':{
689
690 $action = array(
691 'action' => 'custom',
692 'name' => acfe_get($row, 'field_acfe_form_custom_action'),
693 );
694
695 // append action
696 $item['actions'][] = $action;
697
698 break;
699 }
700
701 /**
702 * email
703 */
704 case 'email':{
705
706 $action = array(
707 'action' => 'email',
708 'name' => acfe_get($row, 'field_acfe_form_email_custom_alias'),
709 'email' => array(
710 'from' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_from')),
711 'to' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_to')),
712 'reply_to' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_reply_to')),
713 'cc' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_cc')),
714 'bcc' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_bcc')),
715 'subject' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_subject')),
716 'content' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_email_content')),
717 ),
718 'attachments' => array(),
719 );
720
721 // files dynamic
722 foreach(acfe_as_array($row['field_acfe_form_email_files']) as $file){
723 $action['attachments'][] = array(
724 'file' => $this->handle_field_tags(acfe_get($file, 'field_acfe_form_email_file')),
725 'delete' => acfe_get($file, 'field_acfe_form_email_file_delete'),
726 );
727 }
728
729 // files static
730 foreach(acfe_as_array($row['field_acfe_form_email_files_static']) as $file){
731 $action['attachments'][] = acfe_get($file, 'field_acfe_form_email_file_static');
732 }
733
734 // append action
735 $item['actions'][] = $action;
736
737 break;
738 }
739
740 /**
741 * option
742 */
743 case 'option':{
744
745 $action = array(
746 'action' => 'option',
747 'name' => acfe_get($row, 'field_acfe_form_option_custom_alias'),
748 'save' => array(
749 'target' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_option_save_target')),
750 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_option_save_meta')),
751 ),
752 'load' => array(
753 'source' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_option_load_source')),
754 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_option_load_meta')),
755 ),
756 );
757
758 // load
759 $load_values = acfe_get($row, 'field_acfe_form_option_load_values');
760
761 // reset load if disabled
762 if(!$load_values){
763 unset($action['load']);
764 }
765
766 // append action
767 $item['actions'][] = $action;
768
769 break;
770 }
771
772 /**
773 * post
774 */
775 case 'post':{
776
777 $action = array(
778 'action' => 'post',
779 'type' => acfe_get($row, 'field_acfe_form_post_action'), // insert_post | update_post
780 'name' => acfe_get($row, 'field_acfe_form_post_custom_alias'),
781 'save' => array(
782 'target' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_target')),
783 'post_type' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_type')),
784 'post_status' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_status')),
785 'post_title' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_title')),
786 'post_name' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_name')),
787 'post_content' => '',
788 'post_excerpt' => '',
789 'post_author' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_author')),
790 'post_parent' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_parent')),
791 'post_date' => '',
792 'post_thumbnail' => '',
793 'post_terms' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_save_post_terms')),
794 'append_terms' => '',
795 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_post_save_meta')),
796 ),
797 'load' => array(
798 'source' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_post_load_source')),
799 'post_type' => acfe_get($row, 'field_acfe_form_post_map_post_type'),
800 'post_status' => acfe_get($row, 'field_acfe_form_post_map_post_status'),
801 'post_title' => acfe_get($row, 'field_acfe_form_post_map_post_title'),
802 'post_name' => acfe_get($row, 'field_acfe_form_post_map_post_name'),
803 'post_content' => acfe_get($row, 'field_acfe_form_post_map_post_content'),
804 'post_excerpt' => acfe_get($row, 'field_acfe_form_post_map_post_excerpt'),
805 'post_author' => acfe_get($row, 'field_acfe_form_post_map_post_author'),
806 'post_parent' => acfe_get($row, 'field_acfe_form_post_map_post_parent'),
807 'post_date' => '',
808 'post_thumbnail' => '',
809 'post_terms' => acfe_get($row, 'field_acfe_form_post_map_post_terms'),
810 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_post_load_meta')),
811 ),
812 );
813
814 // post content
815 $group = acfe_get($row, 'field_acfe_form_post_save_post_content_group');
816 $post_content = $group['field_acfe_form_post_save_post_content'];
817 $post_content_custom = $group['field_acfe_form_post_save_post_content_custom'];
818
819 if($post_content === 'custom'){
820 $post_content = $post_content_custom;
821 }
822
823 // post excerpt
824 $group = acfe_get($row, 'field_acfe_form_post_save_post_excerpt_group');
825 $post_excerpt = $group['field_acfe_form_post_save_post_excerpt'];
826 $post_excerpt_custom = $group['field_acfe_form_post_save_post_excerpt_custom'];
827
828 if($post_excerpt === 'custom'){
829 $post_excerpt = $post_excerpt_custom;
830 }
831
832 // assign
833 $action['save']['post_content'] = $this->handle_field_tags($post_content);
834 $action['save']['post_excerpt'] = $this->handle_field_tags($post_excerpt);
835
836 // load
837 $load_values = acfe_get($row, 'field_acfe_form_post_load_values');
838
839 // reset load if disabled
840 if(!$load_values){
841 unset($action['load']);
842
843 }else{
844
845 // load loop
846 foreach(array_keys($action['load']) as $key){
847
848 $value = $action['load'][ $key ];
849
850 // assign save key with {field:field_abcdef123456}
851 if(isset($action['save'][ $key ]) && !empty($value) && is_string($value) && acf_is_field_key($value)){
852 $action['save'][ $key ] = "{field:$value}";
853 }
854
855 }
856
857 }
858
859 // append action
860 $item['actions'][] = $action;
861
862 break;
863 }
864
865 /**
866 * redirect
867 */
868 case 'redirect':{
869
870 $action = array(
871 'action' => 'redirect',
872 'name' => acfe_get($row, 'field_acfe_form_redirect_custom_alias'),
873 'url' => acfe_get($row, 'field_acfe_form_redirect_url'),
874 );
875
876 // append action
877 $item['actions'][] = $action;
878
879 break;
880 }
881
882 /**
883 * term
884 */
885 case 'term':{
886
887 $action = array(
888 'action' => 'term',
889 'type' => acfe_get($row, 'field_acfe_form_term_action'), // insert_term | update_term
890 'name' => acfe_get($row, 'field_acfe_form_term_custom_alias'),
891 'save' => array(
892 'target' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_term_save_target')),
893 'name' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_term_save_name')),
894 'slug' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_term_save_slug')),
895 'taxonomy' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_term_save_taxonomy')),
896 'parent' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_term_save_parent')),
897 'description' => '',
898 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_term_save_meta')),
899 ),
900 'load' => array(
901 'source' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_term_load_source')),
902 'name' => acfe_get($row, 'field_acfe_form_term_map_name'),
903 'slug' => acfe_get($row, 'field_acfe_form_term_map_slug'),
904 'taxonomy' => acfe_get($row, 'field_acfe_form_term_map_taxonomy'),
905 'parent' => acfe_get($row, 'field_acfe_form_term_map_parent'),
906 'description' => acfe_get($row, 'field_acfe_form_term_map_description'),
907 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_term_load_meta')),
908 ),
909 );
910
911 // description
912 $group = acfe_get($row, 'field_acfe_form_term_save_description_group');
913 $description = $group['field_acfe_form_term_save_description'];
914 $description_custom = $group['field_acfe_form_term_save_description_custom'];
915
916 if($description === 'custom'){
917 $description = $description_custom;
918 }
919
920 // assign
921 $action['save']['description'] = $this->handle_field_tags($description);
922
923 // load
924 $load_values = acfe_get($row, 'field_acfe_form_term_load_values');
925
926 // reset load if disabled
927 if(!$load_values){
928 unset($action['load']);
929
930 }else{
931
932 // load loop
933 foreach(array_keys($action['load']) as $key){
934
935 $value = $action['load'][ $key ];
936
937 // assign save key with {field:field_abcdef123456}
938 if(isset($action['save'][ $key ]) && !empty($value) && is_string($value) && acf_is_field_key($value)){
939 $action['save'][ $key ] = "{field:$value}";
940 }
941
942 }
943
944 }
945
946 // append action
947 $item['actions'][] = $action;
948
949 break;
950 }
951
952 /**
953 * user
954 */
955 case 'user':{
956
957 $action = array(
958 'action' => 'user',
959 'type' => acfe_get($row, 'field_acfe_form_user_action'), // insert_user | update_user | log_user
960 'name' => acfe_get($row, 'field_acfe_form_user_custom_alias'),
961 'login' => array(
962 'type' => acfe_get($row, 'field_acfe_form_user_log_type'),
963 'user' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_login_user')),
964 'pass' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_login_pass')),
965 'remember' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_login_remember')),
966 ),
967 'save' => array(
968 'target' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_target')),
969 'user_email' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_email')),
970 'user_login' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_username')),
971 'user_pass' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_password')),
972 'first_name' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_first_name')),
973 'last_name' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_last_name')),
974 'nickname' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_nickname')),
975 'display_name' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_display_name')),
976 'user_url' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_website')),
977 'description' => '',
978 'role' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_save_role')),
979 'log_user' => false,
980 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_user_save_meta')),
981 ),
982 'load' => array(
983 'source' => $this->handle_field_tags(acfe_get($row, 'field_acfe_form_user_load_source')),
984 'user_email' => acfe_get($row, 'field_acfe_form_user_map_email'),
985 'user_login' => acfe_get($row, 'field_acfe_form_user_map_username'),
986 'user_pass' => acfe_get($row, 'field_acfe_form_user_map_password'),
987 'first_name' => acfe_get($row, 'field_acfe_form_user_map_first_name'),
988 'last_name' => acfe_get($row, 'field_acfe_form_user_map_last_name'),
989 'nickname' => acfe_get($row, 'field_acfe_form_user_map_nickname'),
990 'display_name' => acfe_get($row, 'field_acfe_form_user_map_display_name'),
991 'user_url' => acfe_get($row, 'field_acfe_form_user_map_website'),
992 'description' => acfe_get($row, 'field_acfe_form_user_map_description'),
993 'role' => acfe_get($row, 'field_acfe_form_user_map_role'),
994 'acf_fields' => $this->handle_acf_fields(acfe_get($row, 'field_acfe_form_user_load_meta')),
995 ),
996 );
997
998 // description
999 $group = acfe_get($row, 'field_acfe_form_user_save_description_group');
1000 $description = $group['field_acfe_form_user_save_description'];
1001 $description_custom = $group['field_acfe_form_user_save_description_custom'];
1002
1003 if($description === 'custom'){
1004 $description = $description_custom;
1005 }
1006
1007 // assign
1008 $action['save']['description'] = $this->handle_field_tags($description);
1009
1010 // load
1011 $load_values = acfe_get($row, 'field_acfe_form_user_load_values');
1012
1013 // reset load if disabled
1014 if(!$load_values){
1015 unset($action['load']);
1016
1017 }else{
1018
1019 // load loop
1020 foreach(array_keys($action['load']) as $key){
1021
1022 $value = $action['load'][ $key ];
1023
1024 // assign save key with {field:field_abcdef123456}
1025 if(isset($action['save'][ $key ]) && !empty($value) && is_string($value) && acf_is_field_key($value)){
1026 $action['save'][ $key ] = "{field:$value}";
1027 }
1028
1029 }
1030
1031 }
1032
1033 // append action
1034 $item['actions'][] = $action;
1035
1036 break;
1037 }
1038
1039 }
1040
1041 }
1042
1043 return $item;
1044
1045 }
1046
1047
1048 /**
1049 * handle_field_tags
1050 *
1051 * @param $field
1052 *
1053 * @return mixed|string
1054 */
1055 function handle_field_tags($field){
1056
1057 // array
1058 if(is_array($field)){
1059 foreach(array_keys($field) as $k){
1060 $field[ $k ] = $this->handle_field_tags($field[ $k ]);
1061 }
1062 }
1063
1064 // not string or empty
1065 if(!is_string($field) || empty($field)){
1066 return $field;
1067 }
1068
1069 // direct tags
1070 $search_replace = array(
1071 'generated_id' => '{generated_id}',
1072 '#generated_id' => '#{generated_id}',
1073 'generate_password' => '{generate_password}',
1074 'current_post' => '{post}',
1075 'current_post_parent' => '{post:post_parent}',
1076 'current_post_author' => '{post:post_author}',
1077 'current_term' => '{term}',
1078 'current_term_parent' => '{term:parent}',
1079 'current_user' => '{user}',
1080 );
1081
1082 // loop
1083 foreach($search_replace as $search => $replace){
1084 if($field === $search){
1085 $field = $replace;
1086 }
1087 }
1088
1089 // field_abcdef123456
1090 if(is_string($field) && preg_match('/^field_[a-zA-Z0-9]+/', $field) && acf_is_field_key($field)){
1091 $field = "{field:{$field}}";
1092 }
1093
1094 // return
1095 return $field;
1096
1097 }
1098
1099
1100 /**
1101 * handle_acf_fields
1102 *
1103 * @param $fields
1104 *
1105 * @return array|mixed
1106 */
1107 function handle_acf_fields($fields){
1108
1109 if(!is_array($fields) || empty($fields)){
1110 return $fields;
1111 }
1112
1113 $is_clone_enabled = acf_is_filter_enabled('clone');
1114
1115 if($is_clone_enabled){
1116 acf_disable_filter('clone');
1117 }
1118
1119 // loop over fields and check if value is a acf_field_key, then use acf_get_field() to check if the field type is a group, if it is a group then append the sub_fields to the main $fields
1120 foreach(array_keys($fields) as $k){
1121
1122 $field_key = $fields[ $k ];
1123
1124 // check if field value is a acf field key
1125 if(!is_string($field_key) || !preg_match('/^field_[a-zA-Z0-9]+/', $field_key) || !acf_is_field_key($field_key)){
1126 continue;
1127 }
1128
1129 // get field
1130 $field = acf_get_field($field_key);
1131
1132 // validate
1133 if(!$field){
1134 continue;
1135 }
1136
1137 // check if field is a group
1138 if($field['type'] !== 'group'){
1139 continue;
1140 }
1141
1142 // remove main group field from values
1143 unset($fields[ $k ]);
1144
1145 if(empty($field['sub_fields'])){
1146 continue;
1147 }
1148
1149 $sub_fields = acfe_get_fields_details_recursive($field['sub_fields'], array($this, 'get_fields_details'));
1150
1151 if(!empty($sub_fields)){
1152
1153 foreach($sub_fields as $sub_field){
1154 $fields[] = $sub_field['key'];
1155 }
1156
1157 }
1158
1159 }
1160
1161 if($is_clone_enabled){
1162 acf_enable_filter('clone');
1163 }
1164
1165 return $fields;
1166
1167 }
1168
1169
1170 /**
1171 * get_fields_details
1172 *
1173 * @param $field
1174 *
1175 * @return false
1176 */
1177 function get_fields_details($field){
1178
1179 // disallow tab, message, accordion
1180 if(in_array($field['type'], array('tab', 'message', 'accordion'))){
1181 return false;
1182 }
1183
1184 // disallow subfields for repeater/flexible content
1185 if(in_array($field['type'], array('repeater', 'flexible_content'))){
1186 $field['sub_fields'] = array();
1187 }
1188
1189 return $field;
1190
1191 }
1192
1193
1194 /**
1195 * remove_v2_field_group
1196 *
1197 * Remove old local field group for 0.9
1198 */
1199 function remove_v2_field_group(){
1200 acf_remove_local_field_group('group_acfe_dynamic_form');
1201 }
1202
1203
1204 /**
1205 * add_v2_field_group
1206 *
1207 * Add old local field group for 0.9
1208 */
1209 function add_v2_field_group(){
1210
1211 $layouts = array();
1212
1213 $layouts['layout_custom'] = array(
1214 'key' => 'layout_custom',
1215 'name' => 'custom',
1216 'label' => 'Custom action',
1217 'display' => 'row',
1218 'sub_fields' => array(
1219
1220 /*
1221 * Documentation
1222 */
1223 array(
1224 'key' => 'field_acfe_form_custom_action_docs',
1225 'label' => '',
1226 'name' => 'acfe_form_action_docs',
1227 'type' => 'acfe_dynamic_render',
1228 'instructions' => '',
1229 'required' => 0,
1230 'conditional_logic' => 0,
1231 'wrapper' => array(
1232 'width' => '',
1233 'class' => '',
1234 'id' => '',
1235 ),
1236 'render' => function(){
1237 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/custom-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
1238 }
1239 ),
1240
1241 /*
1242 * Layout: Custom Action
1243 */
1244 array(
1245 'key' => 'field_acfe_form_custom_action_tab_action',
1246 'label' => 'Action',
1247 'name' => '',
1248 'type' => 'tab',
1249 'instructions' => '',
1250 'required' => 0,
1251 'conditional_logic' => 0,
1252 'wrapper' => array(
1253 'width' => '',
1254 'class' => '',
1255 'id' => '',
1256 'data-no-preference' => true,
1257 ),
1258 'acfe_permissions' => '',
1259 'placement' => 'top',
1260 'endpoint' => 0,
1261 ),
1262 array(
1263 'key' => 'field_acfe_form_custom_action',
1264 'label' => 'Action name',
1265 'name' => 'acfe_form_custom_action',
1266 'type' => 'acfe_slug',
1267 'instructions' => __('Set a unique action slug.', 'acfe'),
1268 'required' => 1,
1269 'conditional_logic' => 0,
1270 'wrapper' => array(
1271 'width' => '',
1272 'class' => '',
1273 'id' => '',
1274 'data-instruction-placement' => 'field'
1275 ),
1276 'acfe_permissions' => '',
1277 'default_value' => '',
1278 'placeholder' => 'my-custom-action',
1279 'prepend' => '',
1280 'append' => '',
1281 'maxlength' => '',
1282 ),
1283 ),
1284 'min' => '',
1285 'max' => '',
1286 );
1287
1288 $layouts['layout_email'] = array(
1289 'key' => 'layout_email',
1290 'name' => 'email',
1291 'label' => 'Email action',
1292 'display' => 'row',
1293 'sub_fields' => array(
1294
1295 /*
1296 * Documentation
1297 */
1298 array(
1299 'key' => 'field_acfe_form_email_action_docs',
1300 'label' => '',
1301 'name' => 'acfe_form_action_docs',
1302 'type' => 'acfe_dynamic_render',
1303 'instructions' => '',
1304 'required' => 0,
1305 'conditional_logic' => 0,
1306 'wrapper' => array(
1307 'width' => '',
1308 'class' => '',
1309 'id' => '',
1310 ),
1311 'render' => function(){
1312 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/e-mail-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
1313 }
1314 ),
1315
1316 /*
1317 * Layout: Email Action
1318 */
1319 array(
1320 'key' => 'field_acfe_form_email_tab_action',
1321 'label' => 'Action',
1322 'name' => '',
1323 'type' => 'tab',
1324 'instructions' => '',
1325 'required' => 0,
1326 'conditional_logic' => 0,
1327 'wrapper' => array(
1328 'width' => '',
1329 'class' => '',
1330 'id' => '',
1331 'data-no-preference' => true,
1332 ),
1333 'acfe_permissions' => '',
1334 'placement' => 'top',
1335 'endpoint' => 0,
1336 ),
1337 array(
1338 'key' => 'field_acfe_form_email_custom_alias',
1339 'label' => 'Action name',
1340 'name' => 'acfe_form_custom_alias',
1341 'type' => 'acfe_slug',
1342 'instructions' => __('(Optional) Target this action using hooks.', 'acfe'),
1343 'required' => 0,
1344 'conditional_logic' => 0,
1345 'wrapper' => array(
1346 'width' => '',
1347 'class' => '',
1348 'id' => '',
1349 'data-instruction-placement' => 'field'
1350 ),
1351 'acfe_permissions' => '',
1352 'default_value' => '',
1353 'placeholder' => 'Email',
1354 'prepend' => '',
1355 'append' => '',
1356 'maxlength' => '',
1357 ),
1358
1359 /*
1360 * Layout: Email Send
1361 */
1362 array(
1363 'key' => 'field_acfe_form_email_tab_email',
1364 'label' => 'Email',
1365 'name' => '',
1366 'type' => 'tab',
1367 'instructions' => '',
1368 'required' => 0,
1369 'conditional_logic' => 0,
1370 'wrapper' => array(
1371 'width' => '',
1372 'class' => '',
1373 'id' => '',
1374 ),
1375 'acfe_permissions' => '',
1376 'placement' => 'top',
1377 'endpoint' => 0,
1378 ),
1379 array(
1380 'key' => 'field_acfe_form_email_from',
1381 'label' => 'From',
1382 'name' => 'acfe_form_email_from',
1383 'type' => 'text',
1384 'instructions' => '',
1385 'required' => 0,
1386 'conditional_logic' => 0,
1387 'wrapper' => array(
1388 'width' => '',
1389 'class' => '',
1390 'id' => '',
1391 ),
1392 'acfe_permissions' => '',
1393 'default_value' => '',
1394 'placeholder' => 'Name <email@domain.com>',
1395 'prepend' => '',
1396 'append' => '',
1397 'maxlength' => '',
1398 ),
1399 array(
1400 'key' => 'field_acfe_form_email_to',
1401 'label' => 'To',
1402 'name' => 'acfe_form_email_to',
1403 'type' => 'text',
1404 'instructions' => '',
1405 'required' => 0,
1406 'conditional_logic' => 0,
1407 'wrapper' => array(
1408 'width' => '',
1409 'class' => '',
1410 'id' => '',
1411 ),
1412 'acfe_permissions' => '',
1413 'default_value' => '',
1414 'placeholder' => 'email@domain.com',
1415 'prepend' => '',
1416 'append' => '',
1417 ),
1418 array(
1419 'key' => 'field_acfe_form_email_reply_to',
1420 'label' => 'Reply to',
1421 'name' => 'acfe_form_email_reply_to',
1422 'type' => 'text',
1423 'instructions' => '',
1424 'required' => 0,
1425 'conditional_logic' => 0,
1426 'wrapper' => array(
1427 'width' => '',
1428 'class' => '',
1429 'id' => '',
1430 ),
1431 'acfe_permissions' => '',
1432 'default_value' => '',
1433 'placeholder' => 'Name <email@domain.com>',
1434 'prepend' => '',
1435 'append' => '',
1436 'maxlength' => '',
1437 ),
1438 array(
1439 'key' => 'field_acfe_form_email_cc',
1440 'label' => 'Cc',
1441 'name' => 'acfe_form_email_cc',
1442 'type' => 'text',
1443 'instructions' => '',
1444 'required' => 0,
1445 'conditional_logic' => 0,
1446 'wrapper' => array(
1447 'width' => '',
1448 'class' => '',
1449 'id' => '',
1450 ),
1451 'acfe_permissions' => '',
1452 'default_value' => '',
1453 'placeholder' => 'email@domain.com',
1454 'prepend' => '',
1455 'append' => '',
1456 'maxlength' => '',
1457 ),
1458 array(
1459 'key' => 'field_acfe_form_email_bcc',
1460 'label' => 'Bcc',
1461 'name' => 'acfe_form_email_bcc',
1462 'type' => 'text',
1463 'instructions' => '',
1464 'required' => 0,
1465 'conditional_logic' => 0,
1466 'wrapper' => array(
1467 'width' => '',
1468 'class' => '',
1469 'id' => '',
1470 ),
1471 'acfe_permissions' => '',
1472 'default_value' => '',
1473 'placeholder' => 'email@domain.com',
1474 'prepend' => '',
1475 'append' => '',
1476 'maxlength' => '',
1477 ),
1478 array(
1479 'key' => 'field_acfe_form_email_subject',
1480 'label' => 'Subject',
1481 'name' => 'acfe_form_email_subject',
1482 'type' => 'text',
1483 'instructions' => '',
1484 'required' => 0,
1485 'conditional_logic' => 0,
1486 'wrapper' => array(
1487 'width' => '',
1488 'class' => '',
1489 'id' => '',
1490 ),
1491 'acfe_permissions' => '',
1492 'default_value' => '',
1493 'placeholder' => '',
1494 'prepend' => '',
1495 'append' => '',
1496 'maxlength' => '',
1497 ),
1498 array(
1499 'key' => 'field_acfe_form_email_content',
1500 'label' => 'Content',
1501 'name' => 'acfe_form_email_content',
1502 'type' => 'wysiwyg',
1503 'instructions' => 'Fields values may be included using <code>{field:field_key}</code> <code>{field:title}</code>. All fields may be included using <code>{fields}</code>.<br />See "Cheatsheet" tab for advanced usage.',
1504 'required' => 0,
1505 'conditional_logic' => 0,
1506 'wrapper' => array(
1507 'width' => '',
1508 'class' => '',
1509 'id' => '',
1510 'data-instruction-placement' => 'field'
1511 ),
1512 'acfe_permissions' => '',
1513 'default_value' => '',
1514 'tabs' => 'all',
1515 'toolbar' => 'full',
1516 'media_upload' => 1,
1517 'delay' => 0,
1518 ),
1519
1520 /*
1521 * Layout: Email Attachments
1522 */
1523 array(
1524 'key' => 'field_acfe_form_email_tab_attachments',
1525 'label' => 'Attachments',
1526 'name' => '',
1527 'type' => 'tab',
1528 'instructions' => '',
1529 'required' => 0,
1530 'conditional_logic' => 0,
1531 'wrapper' => array(
1532 'width' => '',
1533 'class' => '',
1534 'id' => '',
1535 ),
1536 'acfe_permissions' => '',
1537 'placement' => 'top',
1538 'endpoint' => 0,
1539 ),
1540 array(
1541 'key' => 'field_acfe_form_email_files',
1542 'label' => 'Dynamic files',
1543 'name' => 'acfe_form_email_files',
1544 'type' => 'repeater',
1545 'instructions' => '',
1546 'required' => 0,
1547 'conditional_logic' => 0,
1548 'wrapper' => array(
1549 'width' => '',
1550 'class' => '',
1551 'id' => '',
1552 ),
1553 'acfe_permissions' => '',
1554 'acfe_repeater_stylised_button' => 0,
1555 'collapsed' => '',
1556 'min' => 0,
1557 'max' => 0,
1558 'layout' => 'table',
1559 'button_label' => 'Add file',
1560 'sub_fields' => array(
1561 array(
1562 'key' => 'field_acfe_form_email_file',
1563 'label' => 'File',
1564 'name' => 'acfe_form_email_file',
1565 'type' => 'select',
1566 'instructions' => '',
1567 'required' => 0,
1568 'conditional_logic' => 0,
1569 'wrapper' => array(
1570 'width' => '',
1571 'class' => '',
1572 'id' => '',
1573 ),
1574 'acfe_permissions' => '',
1575 'choices' => array(
1576 ),
1577 'default_value' => array(
1578 ),
1579 'allow_null' => 0,
1580 'multiple' => 0,
1581 'ui' => 1,
1582 'return_format' => 'value',
1583 'ajax' => 0,
1584 'placeholder' => '',
1585 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
1586 'allow_custom' => 1,
1587 ),
1588 array(
1589 'key' => 'field_acfe_form_email_file_delete',
1590 'label' => 'Delete file',
1591 'name' => 'acfe_form_email_file_delete',
1592 'type' => 'true_false',
1593 'instructions' => '',
1594 'required' => 0,
1595 'wrapper' => array(
1596 'width' => '',
1597 'class' => '',
1598 'id' => '',
1599 ),
1600 'acfe_permissions' => '',
1601 'message' => 'Delete once submitted',
1602 'default_value' => 0,
1603 'ui' => 1,
1604 'ui_on_text' => '',
1605 'ui_off_text' => '',
1606 ),
1607 ),
1608 ),
1609 array(
1610 'key' => 'field_acfe_form_email_files_static',
1611 'label' => 'Static files',
1612 'name' => 'acfe_form_email_files_static',
1613 'type' => 'repeater',
1614 'instructions' => '',
1615 'required' => 0,
1616 'conditional_logic' => 0,
1617 'wrapper' => array(
1618 'width' => '',
1619 'class' => '',
1620 'id' => '',
1621 ),
1622 'acfe_permissions' => '',
1623 'acfe_repeater_stylised_button' => 0,
1624 'collapsed' => '',
1625 'min' => 0,
1626 'max' => 0,
1627 'layout' => 'table',
1628 'button_label' => 'Add file',
1629 'sub_fields' => array(
1630 array(
1631 'key' => 'field_acfe_form_email_file_static',
1632 'label' => 'File',
1633 'name' => 'acfe_form_email_file_static',
1634 'type' => 'file',
1635 'instructions' => '',
1636 'required' => 0,
1637 'conditional_logic' => 0,
1638 'wrapper' => array(
1639 'width' => '',
1640 'class' => '',
1641 'id' => '',
1642 ),
1643 'acfe_permissions' => '',
1644 'return_format' => 'id',
1645 ),
1646 ),
1647 ),
1648
1649 ),
1650 'min' => '',
1651 'max' => '',
1652 );
1653
1654 $layouts['layout_post'] = array(
1655 'key' => 'layout_post',
1656 'name' => 'post',
1657 'label' => 'Post action',
1658 'display' => 'row',
1659 'sub_fields' => array(
1660
1661 /*
1662 * Documentation
1663 */
1664 array(
1665 'key' => 'field_acfe_form_post_action_docs',
1666 'label' => '',
1667 'name' => 'acfe_form_action_docs',
1668 'type' => 'acfe_dynamic_render',
1669 'instructions' => '',
1670 'required' => 0,
1671 'conditional_logic' => 0,
1672 'wrapper' => array(
1673 'width' => '',
1674 'class' => '',
1675 'id' => '',
1676 ),
1677 'render' => function(){
1678 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/post-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
1679 }
1680 ),
1681
1682 /*
1683 * Layout: Post Action
1684 */
1685 array(
1686 'key' => 'field_acfe_form_post_tab_action',
1687 'label' => 'Action',
1688 'name' => '',
1689 'type' => 'tab',
1690 'instructions' => '',
1691 'required' => 0,
1692 'conditional_logic' => 0,
1693 'wrapper' => array(
1694 'width' => '',
1695 'class' => '',
1696 'id' => '',
1697 'data-no-preference' => true,
1698 ),
1699 'acfe_permissions' => '',
1700 'placement' => 'top',
1701 'endpoint' => 0,
1702 ),
1703 array(
1704 'key' => 'field_acfe_form_post_action',
1705 'label' => 'Action',
1706 'name' => 'acfe_form_post_action',
1707 'type' => 'radio',
1708 'instructions' => '',
1709 'required' => 0,
1710 'conditional_logic' => 0,
1711 'wrapper' => array(
1712 'width' => '',
1713 'class' => '',
1714 'id' => '',
1715 ),
1716 'acfe_permissions' => '',
1717 'choices' => array(
1718 'insert_post' => 'Create post',
1719 'update_post' => 'Update post',
1720 ),
1721 'default_value' => 'insert_post',
1722 ),
1723 array(
1724 'key' => 'field_acfe_form_post_custom_alias',
1725 'label' => 'Action name',
1726 'name' => 'acfe_form_custom_alias',
1727 'type' => 'acfe_slug',
1728 'instructions' => '(Optional) Target this action using hooks.',
1729 'required' => 0,
1730 'conditional_logic' => 0,
1731 'wrapper' => array(
1732 'width' => '',
1733 'class' => '',
1734 'id' => '',
1735 'data-instruction-placement' => 'field'
1736 ),
1737 'acfe_permissions' => '',
1738 'default_value' => '',
1739 'placeholder' => 'Post',
1740 'prepend' => '',
1741 'append' => '',
1742 'maxlength' => '',
1743 ),
1744
1745 /*
1746 * Layout: Post Save
1747 */
1748 array(
1749 'key' => 'field_acfe_form_post_tab_save',
1750 'label' => 'Save',
1751 'name' => '',
1752 'type' => 'tab',
1753 'instructions' => '',
1754 'required' => 0,
1755 'conditional_logic' => 0,
1756 'wrapper' => array(
1757 'width' => '',
1758 'class' => '',
1759 'id' => '',
1760 ),
1761 'acfe_permissions' => '',
1762 'placement' => 'top',
1763 'endpoint' => 0,
1764 ),
1765 array(
1766 'key' => 'field_acfe_form_post_save_target',
1767 'label' => 'Target',
1768 'name' => 'acfe_form_post_save_target',
1769 'type' => 'select',
1770 'instructions' => '',
1771 'required' => 0,
1772 'conditional_logic' => array(
1773 array(
1774 array(
1775 'field' => 'field_acfe_form_post_action',
1776 'operator' => '==',
1777 'value' => 'update_post',
1778 ),
1779 ),
1780 ),
1781 'wrapper' => array(
1782 'width' => '',
1783 'class' => '',
1784 'id' => '',
1785 'data-instruction-placement' => 'field'
1786 ),
1787 'acfe_permissions' => '',
1788 'choices' => array(
1789 ),
1790 'default_value' => 'current_post',
1791 'allow_null' => 0,
1792 'multiple' => 0,
1793 'ui' => 1,
1794 'ajax' => 0,
1795 'return_format' => 'value',
1796 'placeholder' => '',
1797 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
1798 'allow_custom' => 1,
1799 ),
1800 array(
1801 'key' => 'field_acfe_form_post_save_post_type',
1802 'label' => 'Post type',
1803 'name' => 'acfe_form_post_save_post_type',
1804 'type' => 'acfe_post_types',
1805 'instructions' => '',
1806 'required' => 0,
1807 'conditional_logic' => array(
1808 array(
1809 array(
1810 'field' => 'field_acfe_form_post_map_post_type',
1811 'operator' => '==empty',
1812 ),
1813 ),
1814 ),
1815 'wrapper' => array(
1816 'width' => '',
1817 'class' => '',
1818 'id' => '',
1819 ),
1820 'acfe_permissions' => '',
1821 'post_type' => '',
1822 'field_type' => 'select',
1823 'default_value' => '',
1824 'return_format' => 'name',
1825 'allow_null' => 1,
1826 'placeholder' => 'Default',
1827 'multiple' => 0,
1828 'ui' => 1,
1829 'choices' => array(
1830 ),
1831 'ajax' => 0,
1832 'layout' => '',
1833 'toggle' => 0,
1834 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
1835 'allow_custom' => 1,
1836 ),
1837 array(
1838 'key' => 'field_acfe_form_post_map_post_type_message',
1839 'label' => 'Post type',
1840 'name' => 'acfe_form_post_map_post_type_message',
1841 'type' => 'acfe_dynamic_render',
1842 'instructions' => '',
1843 'required' => 0,
1844 'conditional_logic' => array(
1845 array(
1846 array(
1847 'field' => 'field_acfe_form_post_map_post_type',
1848 'operator' => '!=empty',
1849 ),
1850 ),
1851 ),
1852 'wrapper' => array(
1853 'width' => '',
1854 'class' => '',
1855 'id' => '',
1856 ),
1857 'acfe_permissions' => '',
1858 ),
1859 array(
1860 'key' => 'field_acfe_form_post_save_post_status',
1861 'label' => 'Post status',
1862 'name' => 'acfe_form_post_save_post_status',
1863 'type' => 'acfe_post_statuses',
1864 'instructions' => '',
1865 'required' => 0,
1866 'conditional_logic' => array(
1867 array(
1868 array(
1869 'field' => 'field_acfe_form_post_map_post_status',
1870 'operator' => '==empty',
1871 ),
1872 ),
1873 ),
1874 'wrapper' => array(
1875 'width' => '',
1876 'class' => '',
1877 'id' => '',
1878 ),
1879 'acfe_permissions' => '',
1880 'post_status' => '',
1881 'field_type' => 'select',
1882 'default_value' => '',
1883 'return_format' => 'name',
1884 'allow_null' => 1,
1885 'placeholder' => 'Default',
1886 'multiple' => 0,
1887 'ui' => 1,
1888 'choices' => array(
1889 ),
1890 'ajax' => 0,
1891 'layout' => '',
1892 'toggle' => 0,
1893 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
1894 'allow_custom' => 1,
1895 ),
1896 array(
1897 'key' => 'field_acfe_form_post_map_post_status_message',
1898 'label' => 'Post status',
1899 'name' => 'acfe_form_post_map_post_status_message',
1900 'type' => 'acfe_dynamic_render',
1901 'instructions' => '',
1902 'required' => 0,
1903 'conditional_logic' => array(
1904 array(
1905 array(
1906 'field' => 'field_acfe_form_post_map_post_status',
1907 'operator' => '!=empty',
1908 ),
1909 ),
1910 ),
1911 'wrapper' => array(
1912 'width' => '',
1913 'class' => '',
1914 'id' => '',
1915 ),
1916 'acfe_permissions' => '',
1917 ),
1918
1919 array(
1920 'key' => 'field_acfe_form_post_save_post_title',
1921 'label' => 'Post title',
1922 'name' => 'acfe_form_post_save_post_title',
1923 'type' => 'select',
1924 'instructions' => '',
1925 'required' => 0,
1926 'wrapper' => array(
1927 'width' => '',
1928 'class' => '',
1929 'id' => '',
1930 ),
1931 'acfe_permissions' => '',
1932 'choices' => array(
1933 'generated_id' => 'Generated ID',
1934 '#generated_id' => '#Generated ID',
1935 ),
1936 'default_value' => array(
1937 ),
1938 'allow_null' => 1,
1939 'multiple' => 0,
1940 'ui' => 1,
1941 'return_format' => 'value',
1942 'placeholder' => 'Default',
1943 'ajax' => 0,
1944 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
1945 'allow_custom' => 1,
1946 'conditional_logic' => array(
1947 array(
1948 array(
1949 'field' => 'field_acfe_form_post_map_post_title',
1950 'operator' => '==empty',
1951 ),
1952 ),
1953 ),
1954 ),
1955
1956 array(
1957 'key' => 'field_acfe_form_post_map_post_title_message',
1958 'label' => 'Post title',
1959 'name' => 'acfe_form_post_map_post_title_message',
1960 'type' => 'acfe_dynamic_render',
1961 'instructions' => '',
1962 'required' => 0,
1963 'conditional_logic' => array(
1964 array(
1965 array(
1966 'field' => 'field_acfe_form_post_map_post_title',
1967 'operator' => '!=empty',
1968 ),
1969 ),
1970 ),
1971 'wrapper' => array(
1972 'width' => '',
1973 'class' => '',
1974 'id' => '',
1975 ),
1976 'acfe_permissions' => '',
1977 ),
1978 array(
1979 'key' => 'field_acfe_form_post_save_post_name',
1980 'label' => 'Post slug',
1981 'name' => 'acfe_form_post_save_post_name',
1982 'type' => 'select',
1983 'instructions' => '',
1984 'required' => 0,
1985 'wrapper' => array(
1986 'width' => '',
1987 'class' => '',
1988 'id' => '',
1989 ),
1990 'acfe_permissions' => '',
1991 'choices' => array(
1992 'generated_id' => 'Generated ID',
1993 ),
1994 'default_value' => array(
1995 ),
1996 'allow_null' => 1,
1997 'multiple' => 0,
1998 'ui' => 1,
1999 'return_format' => 'value',
2000 'placeholder' => 'Default',
2001 'ajax' => 0,
2002 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2003 'allow_custom' => 1,
2004 'conditional_logic' => array(
2005 array(
2006 array(
2007 'field' => 'field_acfe_form_post_map_post_name',
2008 'operator' => '==empty',
2009 ),
2010 ),
2011 ),
2012 ),
2013
2014 array(
2015 'key' => 'field_acfe_form_post_map_post_name_message',
2016 'label' => 'Post slug',
2017 'name' => 'acfe_form_post_map_post_name_message',
2018 'type' => 'acfe_dynamic_render',
2019 'instructions' => '',
2020 'required' => 0,
2021 'conditional_logic' => array(
2022 array(
2023 array(
2024 'field' => 'field_acfe_form_post_map_post_name',
2025 'operator' => '!=empty',
2026 ),
2027 ),
2028 ),
2029 'wrapper' => array(
2030 'width' => '',
2031 'class' => '',
2032 'id' => '',
2033 ),
2034 'acfe_permissions' => '',
2035 ),
2036 array(
2037 'key' => 'field_acfe_form_post_save_post_content_group',
2038 'label' => 'Post content',
2039 'name' => 'acfe_form_post_save_post_content_group',
2040 'type' => 'group',
2041 'instructions' => '',
2042 'required' => 0,
2043 'conditional_logic' => array(
2044 array(
2045 array(
2046 'field' => 'field_acfe_form_post_map_post_content',
2047 'operator' => '==empty',
2048 ),
2049 ),
2050 ),
2051 'wrapper' => array(
2052 'width' => '',
2053 'class' => '',
2054 'id' => '',
2055 ),
2056 'acfe_permissions' => '',
2057 'layout' => 'block',
2058 'acfe_seamless_style' => true,
2059 'acfe_group_modal' => 0,
2060 'sub_fields' => array(
2061 array(
2062 'key' => 'field_acfe_form_post_save_post_content',
2063 'label' => '',
2064 'name' => 'acfe_form_post_save_post_content',
2065 'type' => 'select',
2066 'instructions' => '',
2067 'required' => 0,
2068 'conditional_logic' => 0,
2069 'wrapper' => array(
2070 'width' => '',
2071 'class' => '',
2072 'id' => '',
2073 ),
2074 'acfe_permissions' => '',
2075 'choices' => array(
2076 'custom' => 'WYSIWYG editor',
2077 ),
2078 'default_value' => array(
2079 ),
2080 'allow_null' => 1,
2081 'multiple' => 0,
2082 'ui' => 1,
2083 'return_format' => 'value',
2084 'placeholder' => 'Default',
2085 'ajax' => 0,
2086 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2087 'allow_custom' => 1,
2088 ),
2089 array(
2090 'key' => 'field_acfe_form_post_save_post_content_custom',
2091 'label' => '',
2092 'name' => 'acfe_form_post_save_post_content_custom',
2093 'type' => 'wysiwyg',
2094 'instructions' => '',
2095 'required' => 0,
2096 'conditional_logic' => array(
2097 array(
2098 array(
2099 'field' => 'field_acfe_form_post_save_post_content',
2100 'operator' => '==',
2101 'value' => 'custom',
2102 ),
2103 ),
2104 ),
2105 'wrapper' => array(
2106 'width' => '',
2107 'class' => '',
2108 'id' => '',
2109 ),
2110 'acfe_permissions' => '',
2111 'default_value' => '',
2112 'tabs' => 'all',
2113 'toolbar' => 'full',
2114 'media_upload' => 1,
2115 'delay' => 0,
2116 ),
2117 ),
2118 ),
2119 array(
2120 'key' => 'field_acfe_form_post_map_post_content_message',
2121 'label' => 'Post content',
2122 'name' => 'acfe_form_post_map_post_content_message',
2123 'type' => 'acfe_dynamic_render',
2124 'instructions' => '',
2125 'required' => 0,
2126 'conditional_logic' => array(
2127 array(
2128 array(
2129 'field' => 'field_acfe_form_post_map_post_content',
2130 'operator' => '!=empty',
2131 ),
2132 ),
2133 ),
2134 'wrapper' => array(
2135 'width' => '',
2136 'class' => '',
2137 'id' => '',
2138 ),
2139 'acfe_permissions' => '',
2140 ),
2141 array(
2142 'key' => 'field_acfe_form_post_save_post_excerpt_group',
2143 'label' => 'Post excerpt',
2144 'name' => 'acfe_form_post_save_post_excerpt_group',
2145 'type' => 'group',
2146 'instructions' => '',
2147 'required' => 0,
2148 'conditional_logic' => array(
2149 array(
2150 array(
2151 'field' => 'field_acfe_form_post_map_post_excerpt',
2152 'operator' => '==empty',
2153 ),
2154 ),
2155 ),
2156 'wrapper' => array(
2157 'width' => '',
2158 'class' => '',
2159 'id' => '',
2160 ),
2161 'acfe_permissions' => '',
2162 'layout' => 'block',
2163 'acfe_seamless_style' => true,
2164 'acfe_group_modal' => 0,
2165 'sub_fields' => array(
2166 array(
2167 'key' => 'field_acfe_form_post_save_post_excerpt',
2168 'label' => '',
2169 'name' => 'acfe_form_post_save_post_excerpt',
2170 'type' => 'select',
2171 'instructions' => '',
2172 'required' => 0,
2173 'conditional_logic' => 0,
2174 'wrapper' => array(
2175 'width' => '',
2176 'class' => '',
2177 'id' => '',
2178 ),
2179 'acfe_permissions' => '',
2180 'choices' => array(
2181 'custom' => 'Textarea',
2182 ),
2183 'default_value' => array(
2184 ),
2185 'allow_null' => 1,
2186 'multiple' => 0,
2187 'ui' => 1,
2188 'return_format' => 'value',
2189 'placeholder' => 'Default',
2190 'ajax' => 0,
2191 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2192 'allow_custom' => 1,
2193 ),
2194 array(
2195 'key' => 'field_acfe_form_post_save_post_excerpt_custom',
2196 'label' => '',
2197 'name' => 'acfe_form_post_save_post_excerpt_custom',
2198 'type' => 'textarea',
2199 'instructions' => '',
2200 'required' => 0,
2201 'conditional_logic' => array(
2202 array(
2203 array(
2204 'field' => 'field_acfe_form_post_save_post_excerpt',
2205 'operator' => '==',
2206 'value' => 'custom',
2207 ),
2208 ),
2209 ),
2210 'wrapper' => array(
2211 'width' => '',
2212 'class' => '',
2213 'id' => '',
2214 ),
2215 'acfe_permissions' => '',
2216 'default_value' => '',
2217 ),
2218 ),
2219 ),
2220 array(
2221 'key' => 'field_acfe_form_post_map_post_excerpt_message',
2222 'label' => 'Post excerpt',
2223 'name' => 'acfe_form_post_map_post_excerpt_message',
2224 'type' => 'acfe_dynamic_render',
2225 'instructions' => '',
2226 'required' => 0,
2227 'conditional_logic' => array(
2228 array(
2229 array(
2230 'field' => 'field_acfe_form_post_map_post_excerpt',
2231 'operator' => '!=empty',
2232 ),
2233 ),
2234 ),
2235 'wrapper' => array(
2236 'width' => '',
2237 'class' => '',
2238 'id' => '',
2239 ),
2240 'acfe_permissions' => '',
2241 ),
2242 array(
2243 'key' => 'field_acfe_form_post_save_post_author',
2244 'label' => 'Post author',
2245 'name' => 'acfe_form_post_save_post_author',
2246 'type' => 'select',
2247 'instructions' => '',
2248 'required' => 0,
2249 'conditional_logic' => array(
2250 array(
2251 array(
2252 'field' => 'field_acfe_form_post_map_post_author',
2253 'operator' => '==empty',
2254 ),
2255 ),
2256 ),
2257 'wrapper' => array(
2258 'width' => '',
2259 'class' => '',
2260 'id' => '',
2261 ),
2262 'acfe_permissions' => '',
2263 'choices' => array(
2264 ),
2265 'default_value' => array(
2266 ),
2267 'allow_null' => 1,
2268 'multiple' => 0,
2269 'ui' => 1,
2270 'ajax' => 0,
2271 'return_format' => 'value',
2272 'placeholder' => 'Default',
2273 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2274 'allow_custom' => 1,
2275 ),
2276 array(
2277 'key' => 'field_acfe_form_post_map_post_author_message',
2278 'label' => 'Post author',
2279 'name' => 'acfe_form_post_map_post_author_message',
2280 'type' => 'acfe_dynamic_render',
2281 'instructions' => '',
2282 'required' => 0,
2283 'conditional_logic' => array(
2284 array(
2285 array(
2286 'field' => 'field_acfe_form_post_map_post_author',
2287 'operator' => '!=empty',
2288 ),
2289 ),
2290 ),
2291 'wrapper' => array(
2292 'width' => '',
2293 'class' => '',
2294 'id' => '',
2295 ),
2296 'acfe_permissions' => '',
2297 ),
2298 array(
2299 'key' => 'field_acfe_form_post_save_post_parent',
2300 'label' => 'Post parent',
2301 'name' => 'acfe_form_post_save_post_parent',
2302 'type' => 'select',
2303 'instructions' => '',
2304 'required' => 0,
2305 'conditional_logic' => array(
2306 array(
2307 array(
2308 'field' => 'field_acfe_form_post_map_post_parent',
2309 'operator' => '==empty',
2310 ),
2311 ),
2312 ),
2313 'wrapper' => array(
2314 'width' => '',
2315 'class' => '',
2316 'id' => '',
2317 ),
2318 'acfe_permissions' => '',
2319 'choices' => array(
2320 ),
2321 'default_value' => array(
2322 ),
2323 'allow_null' => 1,
2324 'multiple' => 0,
2325 'ui' => 1,
2326 'ajax' => 0,
2327 'return_format' => 'value',
2328 'placeholder' => 'Default',
2329 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2330 'allow_custom' => 1,
2331 ),
2332 array(
2333 'key' => 'field_acfe_form_post_map_post_parent_message',
2334 'label' => 'Post parent',
2335 'name' => 'acfe_form_post_map_post_parent_message',
2336 'type' => 'acfe_dynamic_render',
2337 'instructions' => '',
2338 'required' => 0,
2339 'conditional_logic' => array(
2340 array(
2341 array(
2342 'field' => 'field_acfe_form_post_map_post_parent',
2343 'operator' => '!=empty',
2344 ),
2345 ),
2346 ),
2347 'wrapper' => array(
2348 'width' => '',
2349 'class' => '',
2350 'id' => '',
2351 ),
2352 'acfe_permissions' => '',
2353 ),
2354 array(
2355 'key' => 'field_acfe_form_post_save_post_terms',
2356 'label' => 'Post terms',
2357 'name' => 'acfe_form_post_save_post_terms',
2358 'type' => 'acfe_taxonomy_terms',
2359 'instructions' => '',
2360 'required' => 0,
2361 'conditional_logic' => array(
2362 array(
2363 array(
2364 'field' => 'field_acfe_form_post_map_post_terms',
2365 'operator' => '==empty',
2366 ),
2367 ),
2368 ),
2369 'wrapper' => array(
2370 'width' => '',
2371 'class' => '',
2372 'id' => '',
2373 ),
2374 'acfe_permissions' => '',
2375 'taxonomy' => '',
2376 'field_type' => 'select',
2377 'default_value' => '',
2378 'return_format' => 'id',
2379 'allow_null' => 1,
2380 'placeholder' => 'Default',
2381 'multiple' => 1,
2382 'ui' => 1,
2383 'ajax' => 0,
2384 'choices' => array(
2385 ),
2386 'layout' => '',
2387 'toggle' => 0,
2388 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2389 'allow_custom' => 1,
2390 ),
2391 array(
2392 'key' => 'field_acfe_form_post_map_post_terms_message',
2393 'label' => 'Post terms',
2394 'name' => 'acfe_form_post_map_post_terms_message',
2395 'type' => 'acfe_dynamic_render',
2396 'instructions' => '',
2397 'required' => 0,
2398 'conditional_logic' => array(
2399 array(
2400 array(
2401 'field' => 'field_acfe_form_post_map_post_terms',
2402 'operator' => '!=empty',
2403 ),
2404 ),
2405 ),
2406 'wrapper' => array(
2407 'width' => '',
2408 'class' => '',
2409 'id' => '',
2410 ),
2411 'acfe_permissions' => '',
2412 ),
2413 array(
2414 'key' => 'field_acfe_form_post_save_meta',
2415 'label' => 'Save ACF fields',
2416 'name' => 'acfe_form_post_save_meta',
2417 'type' => 'checkbox',
2418 'instructions' => 'Choose which ACF fields should be saved as metadata',
2419 'required' => 0,
2420 'conditional_logic' => 0,
2421 'wrapper' => array(
2422 'width' => '',
2423 'class' => '',
2424 'id' => '',
2425 ),
2426 'acfe_permissions' => '',
2427 'choices' => array(
2428 ),
2429 'allow_custom' => 0,
2430 'default_value' => array(
2431 ),
2432 'layout' => 'vertical',
2433 'toggle' => 1,
2434 'return_format' => 'value',
2435 'save_custom' => 0,
2436 ),
2437
2438 /*
2439 * Layout: Post Load
2440 */
2441 array(
2442 'key' => 'acfe_form_post_tab_load',
2443 'label' => 'Load',
2444 'name' => '',
2445 'type' => 'tab',
2446 'instructions' => '',
2447 'required' => 0,
2448 'conditional_logic' => 0,
2449 'wrapper' => array(
2450 'width' => '',
2451 'class' => '',
2452 'id' => '',
2453 ),
2454 'acfe_permissions' => '',
2455 'placement' => 'top',
2456 'endpoint' => 0,
2457 ),
2458 array(
2459 'key' => 'field_acfe_form_post_load_values',
2460 'label' => 'Load Values',
2461 'name' => 'acfe_form_post_load_values',
2462 'type' => 'true_false',
2463 'instructions' => 'Fill inputs with values',
2464 'required' => 0,
2465 'conditional_logic' => 0,
2466 'wrapper' => array(
2467 'width' => '',
2468 'class' => '',
2469 'id' => '',
2470 ),
2471 'acfe_permissions' => '',
2472 'message' => '',
2473 'default_value' => 0,
2474 'ui' => 1,
2475 'ui_on_text' => '',
2476 'ui_off_text' => '',
2477 ),
2478 array(
2479 'key' => 'field_acfe_form_post_load_source',
2480 'label' => 'Source',
2481 'name' => 'acfe_form_post_load_source',
2482 'type' => 'select',
2483 'instructions' => '',
2484 'required' => 0,
2485 'conditional_logic' => array(
2486 array(
2487 array(
2488 'field' => 'field_acfe_form_post_load_values',
2489 'operator' => '==',
2490 'value' => '1',
2491 ),
2492 ),
2493 ),
2494 'wrapper' => array(
2495 'width' => '',
2496 'class' => '',
2497 'id' => '',
2498 'data-instruction-placement' => 'field'
2499 ),
2500 'acfe_permissions' => '',
2501 'choices' => array(
2502 ),
2503 'default_value' => 'current_post',
2504 'allow_null' => 0,
2505 'multiple' => 0,
2506 'ui' => 1,
2507 'ajax' => 0,
2508 'return_format' => 'value',
2509 'placeholder' => '',
2510 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2511 'allow_custom' => 1,
2512 ),
2513
2514 array(
2515 'key' => 'field_acfe_form_post_map_post_type',
2516 'label' => 'Post type',
2517 'name' => 'acfe_form_post_map_post_type',
2518 'type' => 'select',
2519 'instructions' => '',
2520 'required' => 0,
2521 'wrapper' => array(
2522 'width' => '',
2523 'class' => '',
2524 'id' => '',
2525 ),
2526 'acfe_permissions' => '',
2527 'choices' => array(
2528 ),
2529 'default_value' => array(
2530 ),
2531 'allow_null' => 1,
2532 'multiple' => 0,
2533 'ui' => 1,
2534 'return_format' => 'value',
2535 'placeholder' => 'Default',
2536 'ajax' => 0,
2537 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2538 'allow_custom' => 1,
2539 'conditional_logic' => array(
2540 array(
2541 array(
2542 'field' => 'field_acfe_form_post_load_values',
2543 'operator' => '==',
2544 'value' => '1',
2545 ),
2546 ),
2547 ),
2548 ),
2549 array(
2550 'key' => 'field_acfe_form_post_map_post_status',
2551 'label' => 'Post status',
2552 'name' => 'acfe_form_post_map_post_status',
2553 'type' => 'select',
2554 'instructions' => '',
2555 'required' => 0,
2556 'wrapper' => array(
2557 'width' => '',
2558 'class' => '',
2559 'id' => '',
2560 ),
2561 'acfe_permissions' => '',
2562 'choices' => array(
2563 ),
2564 'default_value' => array(
2565 ),
2566 'allow_null' => 1,
2567 'multiple' => 0,
2568 'ui' => 1,
2569 'return_format' => 'value',
2570 'placeholder' => 'Default',
2571 'ajax' => 0,
2572 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2573 'allow_custom' => 1,
2574 'conditional_logic' => array(
2575 array(
2576 array(
2577 'field' => 'field_acfe_form_post_load_values',
2578 'operator' => '==',
2579 'value' => '1',
2580 ),
2581 ),
2582 ),
2583 ),
2584 array(
2585 'key' => 'field_acfe_form_post_map_post_title',
2586 'label' => 'Post title',
2587 'name' => 'acfe_form_post_map_post_title',
2588 'type' => 'select',
2589 'instructions' => '',
2590 'required' => 0,
2591 'wrapper' => array(
2592 'width' => '',
2593 'class' => '',
2594 'id' => '',
2595 ),
2596 'acfe_permissions' => '',
2597 'choices' => array(
2598 ),
2599 'default_value' => array(
2600 ),
2601 'allow_null' => 1,
2602 'multiple' => 0,
2603 'ui' => 1,
2604 'return_format' => 'value',
2605 'placeholder' => 'Default',
2606 'ajax' => 0,
2607 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2608 'allow_custom' => 1,
2609 'conditional_logic' => array(
2610 array(
2611 array(
2612 'field' => 'field_acfe_form_post_load_values',
2613 'operator' => '==',
2614 'value' => '1',
2615 ),
2616 ),
2617 ),
2618 ),
2619 array(
2620 'key' => 'field_acfe_form_post_map_post_name',
2621 'label' => 'Post slug',
2622 'name' => 'acfe_form_post_map_post_name',
2623 'type' => 'select',
2624 'instructions' => '',
2625 'required' => 0,
2626 'wrapper' => array(
2627 'width' => '',
2628 'class' => '',
2629 'id' => '',
2630 ),
2631 'acfe_permissions' => '',
2632 'choices' => array(
2633 ),
2634 'default_value' => array(
2635 ),
2636 'allow_null' => 1,
2637 'multiple' => 0,
2638 'ui' => 1,
2639 'return_format' => 'value',
2640 'placeholder' => 'Default',
2641 'ajax' => 0,
2642 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2643 'allow_custom' => 1,
2644 'conditional_logic' => array(
2645 array(
2646 array(
2647 'field' => 'field_acfe_form_post_load_values',
2648 'operator' => '==',
2649 'value' => '1',
2650 ),
2651 ),
2652 ),
2653 ),
2654 array(
2655 'key' => 'field_acfe_form_post_map_post_content',
2656 'label' => 'Post content',
2657 'name' => 'acfe_form_post_map_post_content',
2658 'type' => 'select',
2659 'instructions' => '',
2660 'required' => 0,
2661 'wrapper' => array(
2662 'width' => '',
2663 'class' => '',
2664 'id' => '',
2665 ),
2666 'acfe_permissions' => '',
2667 'choices' => array(
2668 ),
2669 'default_value' => array(
2670 ),
2671 'allow_null' => 1,
2672 'multiple' => 0,
2673 'ui' => 1,
2674 'return_format' => 'value',
2675 'placeholder' => 'Default',
2676 'ajax' => 0,
2677 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2678 'allow_custom' => 1,
2679 'conditional_logic' => array(
2680 array(
2681 array(
2682 'field' => 'field_acfe_form_post_load_values',
2683 'operator' => '==',
2684 'value' => '1',
2685 ),
2686 ),
2687 ),
2688 ),
2689 array(
2690 'key' => 'field_acfe_form_post_map_post_excerpt',
2691 'label' => 'Post excerpt',
2692 'name' => 'acfe_form_post_map_post_excerpt',
2693 'type' => 'select',
2694 'instructions' => '',
2695 'required' => 0,
2696 'wrapper' => array(
2697 'width' => '',
2698 'class' => '',
2699 'id' => '',
2700 ),
2701 'acfe_permissions' => '',
2702 'choices' => array(
2703 ),
2704 'default_value' => array(
2705 ),
2706 'allow_null' => 1,
2707 'multiple' => 0,
2708 'ui' => 1,
2709 'return_format' => 'value',
2710 'placeholder' => 'Default',
2711 'ajax' => 0,
2712 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2713 'allow_custom' => 1,
2714 'conditional_logic' => array(
2715 array(
2716 array(
2717 'field' => 'field_acfe_form_post_load_values',
2718 'operator' => '==',
2719 'value' => '1',
2720 ),
2721 ),
2722 ),
2723 ),
2724 array(
2725 'key' => 'field_acfe_form_post_map_post_author',
2726 'label' => 'Post author',
2727 'name' => 'acfe_form_post_map_post_author',
2728 'type' => 'select',
2729 'instructions' => '',
2730 'required' => 0,
2731 'wrapper' => array(
2732 'width' => '',
2733 'class' => '',
2734 'id' => '',
2735 ),
2736 'acfe_permissions' => '',
2737 'choices' => array(
2738 ),
2739 'default_value' => array(
2740 ),
2741 'allow_null' => 1,
2742 'multiple' => 0,
2743 'ui' => 1,
2744 'return_format' => 'value',
2745 'placeholder' => 'Default',
2746 'ajax' => 0,
2747 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2748 'allow_custom' => 1,
2749 'conditional_logic' => array(
2750 array(
2751 array(
2752 'field' => 'field_acfe_form_post_load_values',
2753 'operator' => '==',
2754 'value' => '1',
2755 ),
2756 ),
2757 ),
2758 ),
2759 array(
2760 'key' => 'field_acfe_form_post_map_post_parent',
2761 'label' => 'Post parent',
2762 'name' => 'acfe_form_post_map_post_parent',
2763 'type' => 'select',
2764 'instructions' => '',
2765 'required' => 0,
2766 'wrapper' => array(
2767 'width' => '',
2768 'class' => '',
2769 'id' => '',
2770 ),
2771 'acfe_permissions' => '',
2772 'choices' => array(
2773 ),
2774 'default_value' => array(
2775 ),
2776 'allow_null' => 1,
2777 'multiple' => 0,
2778 'ui' => 1,
2779 'return_format' => 'value',
2780 'placeholder' => 'Default',
2781 'ajax' => 0,
2782 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2783 'allow_custom' => 1,
2784 'conditional_logic' => array(
2785 array(
2786 array(
2787 'field' => 'field_acfe_form_post_load_values',
2788 'operator' => '==',
2789 'value' => '1',
2790 ),
2791 ),
2792 ),
2793 ),
2794 array(
2795 'key' => 'field_acfe_form_post_map_post_terms',
2796 'label' => 'Post terms',
2797 'name' => 'acfe_form_post_map_post_terms',
2798 'type' => 'select',
2799 'instructions' => '',
2800 'required' => 0,
2801 'wrapper' => array(
2802 'width' => '',
2803 'class' => '',
2804 'id' => '',
2805 ),
2806 'acfe_permissions' => '',
2807 'choices' => array(
2808 ),
2809 'default_value' => array(
2810 ),
2811 'allow_null' => 1,
2812 'multiple' => 0,
2813 'ui' => 1,
2814 'return_format' => 'value',
2815 'placeholder' => 'Default',
2816 'ajax' => 0,
2817 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
2818 'allow_custom' => 1,
2819 'conditional_logic' => array(
2820 array(
2821 array(
2822 'field' => 'field_acfe_form_post_load_values',
2823 'operator' => '==',
2824 'value' => '1',
2825 ),
2826 ),
2827 ),
2828 ),
2829 array(
2830 'key' => 'field_acfe_form_post_load_meta',
2831 'label' => 'Load ACF fields',
2832 'name' => 'acfe_form_post_load_meta',
2833 'type' => 'checkbox',
2834 'instructions' => 'Choose which ACF fields should have their values loaded',
2835 'required' => 0,
2836 'conditional_logic' => array(
2837 array(
2838 array(
2839 'field' => 'field_acfe_form_post_load_values',
2840 'operator' => '==',
2841 'value' => '1',
2842 ),
2843 ),
2844 ),
2845 'wrapper' => array(
2846 'width' => '',
2847 'class' => '',
2848 'id' => '',
2849 ),
2850 'acfe_permissions' => '',
2851 'choices' => array(
2852 ),
2853 'allow_custom' => 0,
2854 'default_value' => array(
2855 ),
2856 'layout' => 'vertical',
2857 'toggle' => 1,
2858 'return_format' => 'value',
2859 'save_custom' => 0,
2860 ),
2861
2862 ),
2863 'min' => '',
2864 'max' => '',
2865 );
2866
2867 $layouts['layout_redirect'] = array(
2868 'key' => 'layout_redirect',
2869 'name' => 'redirect',
2870 'label' => 'Redirect action',
2871 'display' => 'row',
2872 'sub_fields' => array(
2873
2874 /*
2875 * Documentation
2876 */
2877 array(
2878 'key' => 'field_acfe_form_redirect_action_docs',
2879 'label' => '',
2880 'name' => 'acfe_form_action_docs',
2881 'type' => 'acfe_dynamic_render',
2882 'instructions' => '',
2883 'required' => 0,
2884 'conditional_logic' => 0,
2885 'wrapper' => array(
2886 'width' => '',
2887 'class' => '',
2888 'id' => '',
2889 ),
2890 'render' => function(){
2891 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/redirect-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
2892 }
2893 ),
2894
2895 /*
2896 * Layout: Redirect Action
2897 */
2898 array(
2899 'key' => 'field_acfe_form_redirect_action_tab_action',
2900 'label' => 'Action',
2901 'name' => '',
2902 'type' => 'tab',
2903 'instructions' => '',
2904 'required' => 0,
2905 'conditional_logic' => 0,
2906 'wrapper' => array(
2907 'width' => '',
2908 'class' => '',
2909 'id' => '',
2910 'data-no-preference' => true,
2911 ),
2912 'acfe_permissions' => '',
2913 'placement' => 'top',
2914 'endpoint' => 0,
2915 ),
2916 array(
2917 'key' => 'field_acfe_form_redirect_custom_alias',
2918 'label' => 'Action name',
2919 'name' => 'acfe_form_custom_alias',
2920 'type' => 'acfe_slug',
2921 'instructions' => __('(Optional) Target this action using hooks.', 'acfe'),
2922 'required' => 0,
2923 'conditional_logic' => 0,
2924 'wrapper' => array(
2925 'width' => '',
2926 'class' => '',
2927 'id' => '',
2928 'data-instruction-placement' => 'field'
2929 ),
2930 'acfe_permissions' => '',
2931 'default_value' => '',
2932 'placeholder' => 'Redirect',
2933 'prepend' => '',
2934 'append' => '',
2935 'maxlength' => '',
2936 ),
2937 array(
2938 'key' => 'field_acfe_form_redirect_url',
2939 'label' => 'Action URL',
2940 'name' => 'acfe_form_redirect_url',
2941 'type' => 'text',
2942 'instructions' => 'The URL to redirect to. See "Cheatsheet" tab for all available template tags.',
2943 'required' => 0,
2944 'conditional_logic' => 0,
2945 'wrapper' => array(
2946 'width' => '',
2947 'class' => '',
2948 'id' => '',
2949 'data-instruction-placement' => 'field'
2950 ),
2951 'acfe_permissions' => '',
2952 'default_value' => '',
2953 'placeholder' => '',
2954 'prepend' => '',
2955 'append' => '',
2956 'maxlength' => '',
2957 ),
2958
2959 ),
2960 'min' => '',
2961 'max' => '',
2962 );
2963
2964 $layouts['layout_term'] = array(
2965 'key' => 'layout_term',
2966 'name' => 'term',
2967 'label' => 'Term action',
2968 'display' => 'row',
2969 'sub_fields' => array(
2970
2971 /*
2972 * Documentation
2973 */
2974 array(
2975 'key' => 'field_acfe_form_term_action_docs',
2976 'label' => '',
2977 'name' => 'acfe_form_action_docs',
2978 'type' => 'acfe_dynamic_render',
2979 'instructions' => '',
2980 'required' => 0,
2981 'conditional_logic' => 0,
2982 'wrapper' => array(
2983 'width' => '',
2984 'class' => '',
2985 'id' => '',
2986 ),
2987 'render' => function(){
2988 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/term-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
2989 }
2990 ),
2991
2992 /*
2993 * Layout: Term Action
2994 */
2995 array(
2996 'key' => 'field_acfe_form_term_tab_action',
2997 'label' => 'Action',
2998 'name' => '',
2999 'type' => 'tab',
3000 'instructions' => '',
3001 'required' => 0,
3002 'conditional_logic' => 0,
3003 'wrapper' => array(
3004 'width' => '',
3005 'class' => '',
3006 'id' => '',
3007 'data-no-preference' => true,
3008 ),
3009 'acfe_permissions' => '',
3010 'placement' => 'top',
3011 'endpoint' => 0,
3012 ),
3013 array(
3014 'key' => 'acfe_form_term_action',
3015 'label' => 'Action',
3016 'name' => 'acfe_form_term_action',
3017 'type' => 'radio',
3018 'instructions' => '',
3019 'required' => 0,
3020 'conditional_logic' => 0,
3021 'wrapper' => array(
3022 'width' => '',
3023 'class' => '',
3024 'id' => '',
3025 ),
3026 'acfe_permissions' => '',
3027 'choices' => array(
3028 'insert_term' => 'Create term',
3029 'update_term' => 'Update term',
3030 ),
3031 'default_value' => 'insert_term',
3032 ),
3033 array(
3034 'key' => 'field_acfe_form_term_custom_alias',
3035 'label' => 'Action name',
3036 'name' => 'acfe_form_custom_alias',
3037 'type' => 'acfe_slug',
3038 'instructions' => '(Optional) Target this action using hooks.',
3039 'required' => 0,
3040 'conditional_logic' => 0,
3041 'wrapper' => array(
3042 'width' => '',
3043 'class' => '',
3044 'id' => '',
3045 'data-instruction-placement' => 'field'
3046 ),
3047 'acfe_permissions' => '',
3048 'default_value' => '',
3049 'placeholder' => 'Term',
3050 'prepend' => '',
3051 'append' => '',
3052 'maxlength' => '',
3053 ),
3054
3055 /*
3056 * Layout: Term Save
3057 */
3058 array(
3059 'key' => 'field_acfe_form_term_tab_save',
3060 'label' => 'Save',
3061 'name' => '',
3062 'type' => 'tab',
3063 'instructions' => '',
3064 'required' => 0,
3065 'conditional_logic' => 0,
3066 'wrapper' => array(
3067 'width' => '',
3068 'class' => '',
3069 'id' => '',
3070 ),
3071 'acfe_permissions' => '',
3072 'placement' => 'top',
3073 'endpoint' => 0,
3074 ),
3075 array(
3076 'key' => 'field_acfe_form_term_save_target',
3077 'label' => 'Target',
3078 'name' => 'acfe_form_term_save_target',
3079 'type' => 'select',
3080 'instructions' => '',
3081 'required' => 0,
3082 'conditional_logic' => array(
3083 array(
3084 array(
3085 'field' => 'acfe_form_term_action',
3086 'operator' => '==',
3087 'value' => 'update_term',
3088 ),
3089 ),
3090 ),
3091 'wrapper' => array(
3092 'width' => '',
3093 'class' => '',
3094 'id' => '',
3095 'data-instruction-placement' => 'field'
3096 ),
3097 'acfe_permissions' => '',
3098 'choices' => array(
3099 ),
3100 'default_value' => 'current_term',
3101 'allow_null' => 0,
3102 'multiple' => 0,
3103 'ui' => 1,
3104 'ajax' => 0,
3105 'return_format' => 'value',
3106 'placeholder' => '',
3107 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3108 'allow_custom' => 1,
3109 ),
3110 array(
3111 'key' => 'field_acfe_form_term_save_name',
3112 'label' => 'Name',
3113 'name' => 'acfe_form_term_save_name',
3114 'type' => 'select',
3115 'instructions' => '',
3116 'required' => 0,
3117 'wrapper' => array(
3118 'width' => '',
3119 'class' => '',
3120 'id' => '',
3121 ),
3122 'acfe_permissions' => '',
3123 'choices' => array(),
3124 'default_value' => array(
3125 ),
3126 'allow_null' => 1,
3127 'multiple' => 0,
3128 'ui' => 1,
3129 'return_format' => 'value',
3130 'placeholder' => 'Default',
3131 'ajax' => 0,
3132 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3133 'allow_custom' => 1,
3134 'conditional_logic' => array(
3135 array(
3136 array(
3137 'field' => 'field_acfe_form_term_map_name',
3138 'operator' => '==empty',
3139 ),
3140 ),
3141 ),
3142 ),
3143 array(
3144 'key' => 'field_acfe_form_term_map_name_message',
3145 'label' => 'Name',
3146 'name' => 'acfe_form_term_map_name_message',
3147 'type' => 'acfe_dynamic_render',
3148 'instructions' => '',
3149 'required' => 0,
3150 'conditional_logic' => array(
3151 array(
3152 array(
3153 'field' => 'field_acfe_form_term_map_name',
3154 'operator' => '!=empty',
3155 ),
3156 ),
3157 ),
3158 'wrapper' => array(
3159 'width' => '',
3160 'class' => '',
3161 'id' => '',
3162 ),
3163 'acfe_permissions' => '',
3164 ),
3165 array(
3166 'key' => 'field_acfe_form_term_save_slug',
3167 'label' => 'Slug',
3168 'name' => 'acfe_form_term_save_slug',
3169 'type' => 'select',
3170 'instructions' => '',
3171 'required' => 0,
3172 'wrapper' => array(
3173 'width' => '',
3174 'class' => '',
3175 'id' => '',
3176 ),
3177 'acfe_permissions' => '',
3178 'choices' => array(),
3179 'default_value' => array(
3180 ),
3181 'allow_null' => 1,
3182 'multiple' => 0,
3183 'ui' => 1,
3184 'return_format' => 'value',
3185 'placeholder' => 'Default',
3186 'ajax' => 0,
3187 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3188 'allow_custom' => 1,
3189 'conditional_logic' => array(
3190 array(
3191 array(
3192 'field' => 'field_acfe_form_term_map_slug',
3193 'operator' => '==empty',
3194 ),
3195 ),
3196 ),
3197 ),
3198 array(
3199 'key' => 'field_acfe_form_term_map_slug_message',
3200 'label' => 'Slug',
3201 'name' => 'acfe_form_term_map_slug_message',
3202 'type' => 'acfe_dynamic_render',
3203 'instructions' => '',
3204 'required' => 0,
3205 'conditional_logic' => array(
3206 array(
3207 array(
3208 'field' => 'field_acfe_form_term_map_slug',
3209 'operator' => '!=empty',
3210 ),
3211 ),
3212 ),
3213 'wrapper' => array(
3214 'width' => '',
3215 'class' => '',
3216 'id' => '',
3217 ),
3218 'acfe_permissions' => '',
3219 ),
3220 array(
3221 'key' => 'field_acfe_form_term_save_taxonomy',
3222 'label' => 'Taxonomy',
3223 'name' => 'acfe_form_term_save_taxonomy',
3224 'type' => 'acfe_taxonomies',
3225 'instructions' => '',
3226 'required' => 0,
3227 'conditional_logic' => array(
3228 array(
3229 array(
3230 'field' => 'field_acfe_form_term_map_taxonomy',
3231 'operator' => '==empty',
3232 ),
3233 ),
3234 ),
3235 'wrapper' => array(
3236 'width' => '',
3237 'class' => '',
3238 'id' => '',
3239 ),
3240 'acfe_permissions' => '',
3241 'taxonomy' => '',
3242 'field_type' => 'select',
3243 'default_value' => '',
3244 'return_format' => 'name',
3245 'allow_null' => 1,
3246 'placeholder' => 'Default',
3247 'multiple' => 0,
3248 'ui' => 1,
3249 'choices' => array(
3250 ),
3251 'ajax' => 0,
3252 'layout' => '',
3253 'toggle' => 0,
3254 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3255 'allow_custom' => 1,
3256 ),
3257 array(
3258 'key' => 'field_acfe_form_term_map_taxonomy_message',
3259 'label' => 'Taxonomy',
3260 'name' => 'acfe_form_term_map_taxonomy_message',
3261 'type' => 'acfe_dynamic_render',
3262 'instructions' => '',
3263 'required' => 0,
3264 'conditional_logic' => array(
3265 array(
3266 array(
3267 'field' => 'field_acfe_form_term_map_taxonomy',
3268 'operator' => '!=empty',
3269 ),
3270 ),
3271 ),
3272 'wrapper' => array(
3273 'width' => '',
3274 'class' => '',
3275 'id' => '',
3276 ),
3277 'acfe_permissions' => '',
3278 ),
3279 array(
3280 'key' => 'field_acfe_form_term_save_parent',
3281 'label' => 'Parent',
3282 'name' => 'acfe_form_term_save_parent',
3283 'type' => 'select',
3284 'instructions' => '',
3285 'required' => 0,
3286 'conditional_logic' => array(
3287 array(
3288 array(
3289 'field' => 'field_acfe_form_term_map_parent',
3290 'operator' => '==empty',
3291 ),
3292 ),
3293 ),
3294 'wrapper' => array(
3295 'width' => '',
3296 'class' => '',
3297 'id' => '',
3298 ),
3299 'acfe_permissions' => '',
3300 'choices' => array(
3301 ),
3302 'default_value' => array(
3303 ),
3304 'allow_null' => 1,
3305 'multiple' => 0,
3306 'ui' => 1,
3307 'ajax' => 0,
3308 'return_format' => 'value',
3309 'placeholder' => 'Default',
3310 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3311 'allow_custom' => 1,
3312 ),
3313 array(
3314 'key' => 'field_acfe_form_term_map_parent_message',
3315 'label' => 'Parent',
3316 'name' => 'acfe_form_term_map_parent_message',
3317 'type' => 'acfe_dynamic_render',
3318 'instructions' => '',
3319 'required' => 0,
3320 'conditional_logic' => array(
3321 array(
3322 array(
3323 'field' => 'field_acfe_form_term_map_parent',
3324 'operator' => '!=empty',
3325 ),
3326 ),
3327 ),
3328 'wrapper' => array(
3329 'width' => '',
3330 'class' => '',
3331 'id' => '',
3332 ),
3333 'acfe_permissions' => '',
3334 ),
3335 array(
3336 'key' => 'field_acfe_form_term_save_description_group',
3337 'label' => 'Description',
3338 'name' => 'acfe_form_term_save_description_group',
3339 'type' => 'group',
3340 'instructions' => '',
3341 'required' => 0,
3342 'conditional_logic' => array(
3343 array(
3344 array(
3345 'field' => 'field_acfe_form_term_map_description',
3346 'operator' => '==empty',
3347 ),
3348 ),
3349 ),
3350 'wrapper' => array(
3351 'width' => '',
3352 'class' => '',
3353 'id' => '',
3354 ),
3355 'acfe_permissions' => '',
3356 'layout' => 'block',
3357 'acfe_seamless_style' => true,
3358 'acfe_group_modal' => 0,
3359 'sub_fields' => array(
3360 array(
3361 'key' => 'field_acfe_form_term_save_description',
3362 'label' => '',
3363 'name' => 'acfe_form_term_save_description',
3364 'type' => 'select',
3365 'instructions' => '',
3366 'required' => 0,
3367 'conditional_logic' => 0,
3368 'wrapper' => array(
3369 'width' => '',
3370 'class' => '',
3371 'id' => '',
3372 ),
3373 'acfe_permissions' => '',
3374 'choices' => array(
3375 'custom' => 'WYSIWYG Editor',
3376 ),
3377 'default_value' => array(
3378 ),
3379 'allow_null' => 1,
3380 'multiple' => 0,
3381 'ui' => 1,
3382 'return_format' => 'value',
3383 'placeholder' => 'Default',
3384 'ajax' => 0,
3385 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3386 'allow_custom' => 1,
3387 ),
3388 array(
3389 'key' => 'field_acfe_form_term_save_description_custom',
3390 'label' => '',
3391 'name' => 'acfe_form_term_save_description_custom',
3392 'type' => 'wysiwyg',
3393 'instructions' => '',
3394 'required' => 1,
3395 'conditional_logic' => array(
3396 array(
3397 array(
3398 'field' => 'field_acfe_form_term_save_description',
3399 'operator' => '==',
3400 'value' => 'custom',
3401 ),
3402 ),
3403 ),
3404 'wrapper' => array(
3405 'width' => '',
3406 'class' => '',
3407 'id' => '',
3408 ),
3409 'acfe_permissions' => '',
3410 'default_value' => '',
3411 'tabs' => 'all',
3412 'toolbar' => 'full',
3413 'media_upload' => 1,
3414 'delay' => 0,
3415 ),
3416 ),
3417 ),
3418 array(
3419 'key' => 'field_acfe_form_term_map_description_message',
3420 'label' => 'Description',
3421 'name' => 'acfe_form_term_map_description_message',
3422 'type' => 'acfe_dynamic_render',
3423 'instructions' => '',
3424 'required' => 0,
3425 'conditional_logic' => array(
3426 array(
3427 array(
3428 'field' => 'field_acfe_form_term_map_description',
3429 'operator' => '!=empty',
3430 ),
3431 ),
3432 ),
3433 'wrapper' => array(
3434 'width' => '',
3435 'class' => '',
3436 'id' => '',
3437 ),
3438 'acfe_permissions' => '',
3439 ),
3440 array(
3441 'key' => 'field_acfe_form_term_save_meta',
3442 'label' => 'Save ACF fields',
3443 'name' => 'acfe_form_term_save_meta',
3444 'type' => 'checkbox',
3445 'instructions' => 'Choose which ACF fields should be saved as metadata',
3446 'required' => 0,
3447 'conditional_logic' => 0,
3448 'wrapper' => array(
3449 'width' => '',
3450 'class' => '',
3451 'id' => '',
3452 ),
3453 'acfe_permissions' => '',
3454 'choices' => array(
3455 ),
3456 'allow_custom' => 0,
3457 'default_value' => array(
3458 ),
3459 'layout' => 'vertical',
3460 'toggle' => 1,
3461 'return_format' => 'value',
3462 'save_custom' => 0,
3463 ),
3464
3465 /*
3466 * Layout: Term Load
3467 */
3468 array(
3469 'key' => 'field_acfe_form_term_tab_load',
3470 'label' => 'Load',
3471 'name' => '',
3472 'type' => 'tab',
3473 'instructions' => '',
3474 'required' => 0,
3475 'conditional_logic' => 0,
3476 'wrapper' => array(
3477 'width' => '',
3478 'class' => '',
3479 'id' => '',
3480 ),
3481 'acfe_permissions' => '',
3482 'placement' => 'top',
3483 'endpoint' => 0,
3484 ),
3485 array(
3486 'key' => 'field_acfe_form_term_load_values',
3487 'label' => 'Load Values',
3488 'name' => 'acfe_form_term_load_values',
3489 'type' => 'true_false',
3490 'instructions' => 'Fill inputs with values',
3491 'required' => 0,
3492 'conditional_logic' => 0,
3493 'wrapper' => array(
3494 'width' => '',
3495 'class' => '',
3496 'id' => '',
3497 ),
3498 'acfe_permissions' => '',
3499 'message' => '',
3500 'default_value' => 0,
3501 'ui' => 1,
3502 'ui_on_text' => '',
3503 'ui_off_text' => '',
3504 ),
3505 array(
3506 'key' => 'field_acfe_form_term_load_source',
3507 'label' => 'Source',
3508 'name' => 'acfe_form_term_load_source',
3509 'type' => 'select',
3510 'instructions' => '',
3511 'required' => 0,
3512 'conditional_logic' => array(
3513 array(
3514 array(
3515 'field' => 'field_acfe_form_term_load_values',
3516 'operator' => '==',
3517 'value' => '1',
3518 ),
3519 ),
3520 ),
3521 'wrapper' => array(
3522 'width' => '',
3523 'class' => '',
3524 'id' => '',
3525 'data-instruction-placement' => 'field'
3526 ),
3527 'acfe_permissions' => '',
3528 'choices' => array(
3529 ),
3530 'default_value' => 'current_term',
3531 'allow_null' => 0,
3532 'multiple' => 0,
3533 'ui' => 1,
3534 'ajax' => 0,
3535 'return_format' => 'value',
3536 'placeholder' => '',
3537 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3538 'allow_custom' => 1,
3539 ),
3540 array(
3541 'key' => 'field_acfe_form_term_map_name',
3542 'label' => 'Name',
3543 'name' => 'acfe_form_term_map_name',
3544 'type' => 'select',
3545 'instructions' => '',
3546 'required' => 0,
3547 'wrapper' => array(
3548 'width' => '',
3549 'class' => '',
3550 'id' => '',
3551 ),
3552 'acfe_permissions' => '',
3553 'choices' => array(
3554 ),
3555 'default_value' => array(
3556 ),
3557 'allow_null' => 1,
3558 'multiple' => 0,
3559 'ui' => 1,
3560 'return_format' => 'value',
3561 'placeholder' => 'Default',
3562 'ajax' => 0,
3563 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3564 'allow_custom' => 1,
3565 'conditional_logic' => array(
3566 array(
3567 array(
3568 'field' => 'field_acfe_form_term_load_values',
3569 'operator' => '==',
3570 'value' => '1',
3571 ),
3572 ),
3573 ),
3574 ),
3575 array(
3576 'key' => 'field_acfe_form_term_map_slug',
3577 'label' => 'Slug',
3578 'name' => 'acfe_form_term_map_slug',
3579 'type' => 'select',
3580 'instructions' => '',
3581 'required' => 0,
3582 'wrapper' => array(
3583 'width' => '',
3584 'class' => '',
3585 'id' => '',
3586 ),
3587 'acfe_permissions' => '',
3588 'choices' => array(
3589 ),
3590 'default_value' => array(
3591 ),
3592 'allow_null' => 1,
3593 'multiple' => 0,
3594 'ui' => 1,
3595 'return_format' => 'value',
3596 'placeholder' => 'Default',
3597 'ajax' => 0,
3598 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3599 'allow_custom' => 1,
3600 'conditional_logic' => array(
3601 array(
3602 array(
3603 'field' => 'field_acfe_form_term_load_values',
3604 'operator' => '==',
3605 'value' => '1',
3606 ),
3607 ),
3608 ),
3609 ),
3610 array(
3611 'key' => 'field_acfe_form_term_map_taxonomy',
3612 'label' => 'Taxonomy',
3613 'name' => 'acfe_form_term_map_taxonomy',
3614 'type' => 'select',
3615 'instructions' => '',
3616 'required' => 0,
3617 'wrapper' => array(
3618 'width' => '',
3619 'class' => '',
3620 'id' => '',
3621 ),
3622 'acfe_permissions' => '',
3623 'choices' => array(
3624 ),
3625 'default_value' => array(
3626 ),
3627 'allow_null' => 1,
3628 'multiple' => 0,
3629 'ui' => 1,
3630 'return_format' => 'value',
3631 'placeholder' => 'Default',
3632 'ajax' => 0,
3633 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3634 'allow_custom' => 1,
3635 'conditional_logic' => array(
3636 array(
3637 array(
3638 'field' => 'field_acfe_form_term_load_values',
3639 'operator' => '==',
3640 'value' => '1',
3641 ),
3642 ),
3643 ),
3644 ),
3645 array(
3646 'key' => 'field_acfe_form_term_map_parent',
3647 'label' => 'Parent',
3648 'name' => 'acfe_form_term_map_parent',
3649 'type' => 'select',
3650 'instructions' => '',
3651 'required' => 0,
3652 'wrapper' => array(
3653 'width' => '',
3654 'class' => '',
3655 'id' => '',
3656 ),
3657 'acfe_permissions' => '',
3658 'choices' => array(
3659 ),
3660 'default_value' => array(
3661 ),
3662 'allow_null' => 1,
3663 'multiple' => 0,
3664 'ui' => 1,
3665 'return_format' => 'value',
3666 'placeholder' => 'Default',
3667 'ajax' => 0,
3668 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3669 'allow_custom' => 1,
3670 'conditional_logic' => array(
3671 array(
3672 array(
3673 'field' => 'field_acfe_form_term_load_values',
3674 'operator' => '==',
3675 'value' => '1',
3676 ),
3677 ),
3678 ),
3679 ),
3680 array(
3681 'key' => 'field_acfe_form_term_map_description',
3682 'label' => 'Description',
3683 'name' => 'acfe_form_term_map_description',
3684 'type' => 'select',
3685 'instructions' => '',
3686 'required' => 0,
3687 'wrapper' => array(
3688 'width' => '',
3689 'class' => '',
3690 'id' => '',
3691 ),
3692 'acfe_permissions' => '',
3693 'choices' => array(
3694 ),
3695 'default_value' => array(
3696 ),
3697 'allow_null' => 1,
3698 'multiple' => 0,
3699 'ui' => 1,
3700 'return_format' => 'value',
3701 'placeholder' => 'Default',
3702 'ajax' => 0,
3703 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3704 'allow_custom' => 1,
3705 'conditional_logic' => array(
3706 array(
3707 array(
3708 'field' => 'field_acfe_form_term_load_values',
3709 'operator' => '==',
3710 'value' => '1',
3711 ),
3712 ),
3713 ),
3714 ),
3715 array(
3716 'key' => 'field_acfe_form_term_load_meta',
3717 'label' => 'Load ACF fields',
3718 'name' => 'acfe_form_term_load_meta',
3719 'type' => 'checkbox',
3720 'instructions' => 'Choose which ACF fields should have their values loaded',
3721 'required' => 0,
3722 'conditional_logic' => array(
3723 array(
3724 array(
3725 'field' => 'field_acfe_form_term_load_values',
3726 'operator' => '==',
3727 'value' => '1',
3728 ),
3729 ),
3730 ),
3731 'wrapper' => array(
3732 'width' => '',
3733 'class' => '',
3734 'id' => '',
3735 ),
3736 'acfe_permissions' => '',
3737 'choices' => array(
3738 ),
3739 'allow_custom' => 0,
3740 'default_value' => array(
3741 ),
3742 'layout' => 'vertical',
3743 'toggle' => 1,
3744 'return_format' => 'value',
3745 'save_custom' => 0,
3746 ),
3747
3748 ),
3749 'min' => '',
3750 'max' => '',
3751 );
3752
3753 $layouts['layout_user'] = array(
3754 'key' => 'layout_user',
3755 'name' => 'user',
3756 'label' => 'User action',
3757 'display' => 'row',
3758 'sub_fields' => array(
3759
3760 /*
3761 * Documentation
3762 */
3763 array(
3764 'key' => 'field_acfe_form_user_action_docs',
3765 'label' => '',
3766 'name' => 'acfe_form_action_docs',
3767 'type' => 'acfe_dynamic_render',
3768 'instructions' => '',
3769 'required' => 0,
3770 'conditional_logic' => 0,
3771 'wrapper' => array(
3772 'width' => '',
3773 'class' => '',
3774 'id' => '',
3775 ),
3776 'render' => function(){
3777 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/user-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
3778 }
3779 ),
3780
3781 /*
3782 * Layout: User Action
3783 */
3784 array(
3785 'key' => 'field_acfe_form_user_tab_action',
3786 'label' => 'Action',
3787 'name' => '',
3788 'type' => 'tab',
3789 'instructions' => '',
3790 'required' => 0,
3791 'conditional_logic' => 0,
3792 'wrapper' => array(
3793 'width' => '',
3794 'class' => '',
3795 'id' => '',
3796 'data-no-preference' => true,
3797 ),
3798 'acfe_permissions' => '',
3799 'placement' => 'top',
3800 'endpoint' => 0,
3801 ),
3802 array(
3803 'key' => 'field_acfe_form_user_action',
3804 'label' => 'Action',
3805 'name' => 'acfe_form_user_action',
3806 'type' => 'radio',
3807 'instructions' => '',
3808 'required' => 0,
3809 'conditional_logic' => 0,
3810 'wrapper' => array(
3811 'width' => '',
3812 'class' => '',
3813 'id' => '',
3814 ),
3815 'acfe_permissions' => '',
3816 'choices' => array(
3817 'insert_user' => 'Create user',
3818 'update_user' => 'Update user',
3819 'log_user' => 'Log user',
3820 ),
3821 'default_value' => 'insert_post',
3822 ),
3823 array(
3824 'key' => 'field_acfe_form_user_custom_alias',
3825 'label' => 'Action name',
3826 'name' => 'acfe_form_custom_alias',
3827 'type' => 'acfe_slug',
3828 'instructions' => '(Optional) Target this action using hooks.',
3829 'required' => 0,
3830 'conditional_logic' => 0,
3831 'wrapper' => array(
3832 'width' => '',
3833 'class' => '',
3834 'id' => '',
3835 'data-instruction-placement' => 'field'
3836 ),
3837 'acfe_permissions' => '',
3838 'default_value' => '',
3839 'placeholder' => 'User',
3840 'prepend' => '',
3841 'append' => '',
3842 'maxlength' => '',
3843 ),
3844
3845 /*
3846 * Layout: User Login
3847 */
3848 array(
3849 'key' => 'field_acfe_form_user_tab_login',
3850 'label' => 'Login',
3851 'name' => '',
3852 'type' => 'tab',
3853 'instructions' => '',
3854 'required' => 0,
3855 'wrapper' => array(
3856 'width' => '',
3857 'class' => '',
3858 'id' => '',
3859 ),
3860 'acfe_permissions' => '',
3861 'placement' => 'top',
3862 'endpoint' => 0,
3863 'conditional_logic' => array(
3864 array(
3865 array(
3866 'field' => 'field_acfe_form_user_action',
3867 'operator' => '==',
3868 'value' => 'log_user',
3869 ),
3870 ),
3871 ),
3872 ),
3873 array(
3874 'key' => 'field_acfe_form_user_log_type',
3875 'label' => 'Login type',
3876 'name' => 'acfe_form_user_log_type',
3877 'type' => 'radio',
3878 'instructions' => '',
3879 'required' => 0,
3880 'wrapper' => array(
3881 'width' => '',
3882 'class' => '',
3883 'id' => '',
3884 ),
3885 'acfe_permissions' => '',
3886 'choices' => array(
3887 'email' => 'E-mail',
3888 'username' => 'Username',
3889 'email_username' => 'E-mail or username',
3890 ),
3891 'allow_null' => 0,
3892 'other_choice' => 0,
3893 'default_value' => 'email',
3894 'layout' => 'vertical',
3895 'return_format' => 'value',
3896 'save_other_choice' => 0,
3897 'conditional_logic' => array(
3898 array(
3899 array(
3900 'field' => 'field_acfe_form_user_action',
3901 'operator' => '==',
3902 'value' => 'log_user',
3903 ),
3904 ),
3905 ),
3906 ),
3907 array(
3908 'key' => 'field_acfe_form_user_save_login_user',
3909 'label' => 'Login',
3910 'name' => 'acfe_form_user_save_login_user',
3911 'type' => 'select',
3912 'instructions' => '',
3913 'required' => 0,
3914 'wrapper' => array(
3915 'width' => '',
3916 'class' => '',
3917 'id' => '',
3918 ),
3919 'acfe_permissions' => '',
3920 'choices' => array(),
3921 'default_value' => array(
3922 ),
3923 'allow_null' => 1,
3924 'multiple' => 0,
3925 'ui' => 1,
3926 'return_format' => 'value',
3927 'placeholder' => 'Default',
3928 'ajax' => 0,
3929 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3930 'allow_custom' => 1,
3931 'conditional_logic' => array(
3932 array(
3933 array(
3934 'field' => 'field_acfe_form_user_action',
3935 'operator' => '==',
3936 'value' => 'log_user',
3937 ),
3938 ),
3939 ),
3940 ),
3941 array(
3942 'key' => 'field_acfe_form_user_save_login_pass',
3943 'label' => 'Password',
3944 'name' => 'acfe_form_user_save_login_pass',
3945 'type' => 'select',
3946 'instructions' => '',
3947 'required' => 0,
3948 'wrapper' => array(
3949 'width' => '',
3950 'class' => '',
3951 'id' => '',
3952 ),
3953 'acfe_permissions' => '',
3954 'choices' => array(),
3955 'default_value' => array(
3956 ),
3957 'allow_null' => 1,
3958 'multiple' => 0,
3959 'ui' => 1,
3960 'return_format' => 'value',
3961 'placeholder' => 'Default',
3962 'ajax' => 0,
3963 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3964 'allow_custom' => 1,
3965 'conditional_logic' => array(
3966 array(
3967 array(
3968 'field' => 'field_acfe_form_user_action',
3969 'operator' => '==',
3970 'value' => 'log_user',
3971 ),
3972 ),
3973 ),
3974 ),
3975 array(
3976 'key' => 'field_acfe_form_user_save_login_remember',
3977 'label' => 'Remember me',
3978 'name' => 'acfe_form_user_save_login_remember',
3979 'type' => 'select',
3980 'instructions' => '',
3981 'required' => 0,
3982 'wrapper' => array(
3983 'width' => '',
3984 'class' => '',
3985 'id' => '',
3986 ),
3987 'acfe_permissions' => '',
3988 'choices' => array(),
3989 'default_value' => array(
3990 ),
3991 'allow_null' => 1,
3992 'multiple' => 0,
3993 'ui' => 1,
3994 'return_format' => 'value',
3995 'placeholder' => 'Default',
3996 'ajax' => 0,
3997 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
3998 'allow_custom' => 1,
3999 'conditional_logic' => array(
4000 array(
4001 array(
4002 'field' => 'field_acfe_form_user_action',
4003 'operator' => '==',
4004 'value' => 'log_user',
4005 ),
4006 ),
4007 ),
4008 ),
4009
4010 /*
4011 * Layout: User Save
4012 */
4013 array(
4014 'key' => 'field_acfe_form_user_tab_save',
4015 'label' => 'Save',
4016 'name' => '',
4017 'type' => 'tab',
4018 'instructions' => '',
4019 'required' => 0,
4020 'wrapper' => array(
4021 'width' => '',
4022 'class' => '',
4023 'id' => '',
4024 ),
4025 'acfe_permissions' => '',
4026 'placement' => 'top',
4027 'endpoint' => 0,
4028 'conditional_logic' => array(
4029 array(
4030 array(
4031 'field' => 'field_acfe_form_user_action',
4032 'operator' => '!=',
4033 'value' => 'log_user',
4034 ),
4035 ),
4036 ),
4037 ),
4038 array(
4039 'key' => 'field_acfe_form_user_save_target',
4040 'label' => 'Target',
4041 'name' => 'acfe_form_user_save_target',
4042 'type' => 'select',
4043 'instructions' => '',
4044 'required' => 0,
4045 'conditional_logic' => array(
4046 array(
4047 array(
4048 'field' => 'field_acfe_form_user_action',
4049 'operator' => '==',
4050 'value' => 'update_user',
4051 ),
4052 ),
4053 ),
4054 'wrapper' => array(
4055 'width' => '',
4056 'class' => '',
4057 'id' => '',
4058 'data-instruction-placement' => 'field'
4059 ),
4060 'acfe_permissions' => '',
4061 'choices' => array(
4062 ),
4063 'default_value' => 'current_user',
4064 'allow_null' => 0,
4065 'multiple' => 0,
4066 'ui' => 1,
4067 'ajax' => 0,
4068 'return_format' => 'value',
4069 'placeholder' => '',
4070 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4071 'allow_custom' => 1,
4072 ),
4073 array(
4074 'key' => 'field_acfe_form_user_save_email',
4075 'label' => 'Email',
4076 'name' => 'acfe_form_user_save_email',
4077 'type' => 'select',
4078 'instructions' => '',
4079 'required' => 0,
4080 'wrapper' => array(
4081 'width' => '',
4082 'class' => '',
4083 'id' => '',
4084 ),
4085 'acfe_permissions' => '',
4086 'choices' => array(),
4087 'default_value' => array(
4088 ),
4089 'allow_null' => 1,
4090 'multiple' => 0,
4091 'ui' => 1,
4092 'return_format' => 'value',
4093 'placeholder' => 'Default',
4094 'ajax' => 0,
4095 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4096 'allow_custom' => 1,
4097 'conditional_logic' => array(
4098 array(
4099 array(
4100 'field' => 'field_acfe_form_user_map_email',
4101 'operator' => '==empty',
4102 ),
4103 array(
4104 'field' => 'field_acfe_form_user_action',
4105 'operator' => '!=',
4106 'value' => 'log_user',
4107 ),
4108 ),
4109 ),
4110 ),
4111 array(
4112 'key' => 'field_acfe_form_user_map_email_message',
4113 'label' => 'Email',
4114 'name' => 'acfe_form_user_map_email_message',
4115 'type' => 'acfe_dynamic_render',
4116 'instructions' => '',
4117 'required' => 0,
4118 'conditional_logic' => array(
4119 array(
4120 array(
4121 'field' => 'field_acfe_form_user_map_email',
4122 'operator' => '!=empty',
4123 ),
4124 array(
4125 'field' => 'field_acfe_form_user_action',
4126 'operator' => '!=',
4127 'value' => 'log_user',
4128 ),
4129 ),
4130 ),
4131 'wrapper' => array(
4132 'width' => '',
4133 'class' => '',
4134 'id' => '',
4135 ),
4136 'acfe_permissions' => '',
4137 ),
4138 array(
4139 'key' => 'field_acfe_form_user_save_username',
4140 'label' => 'Username',
4141 'name' => 'acfe_form_user_save_username',
4142 'type' => 'select',
4143 'instructions' => '',
4144 'required' => 0,
4145 'wrapper' => array(
4146 'width' => '',
4147 'class' => '',
4148 'id' => '',
4149 ),
4150 'acfe_permissions' => '',
4151 'choices' => array(),
4152 'default_value' => array(
4153 ),
4154 'allow_null' => 1,
4155 'multiple' => 0,
4156 'ui' => 1,
4157 'return_format' => 'value',
4158 'placeholder' => 'Default',
4159 'ajax' => 0,
4160 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4161 'allow_custom' => 1,
4162 'conditional_logic' => array(
4163 array(
4164 array(
4165 'field' => 'field_acfe_form_user_map_username',
4166 'operator' => '==empty',
4167 ),
4168 array(
4169 'field' => 'field_acfe_form_user_action',
4170 'operator' => '!=',
4171 'value' => 'log_user',
4172 ),
4173 ),
4174 ),
4175 ),
4176 array(
4177 'key' => 'field_acfe_form_user_map_username_message',
4178 'label' => 'Username',
4179 'name' => 'acfe_form_user_map_username_message',
4180 'type' => 'acfe_dynamic_render',
4181 'instructions' => '',
4182 'required' => 0,
4183 'conditional_logic' => array(
4184 array(
4185 array(
4186 'field' => 'field_acfe_form_user_map_username',
4187 'operator' => '!=empty',
4188 ),
4189 array(
4190 'field' => 'field_acfe_form_user_action',
4191 'operator' => '!=',
4192 'value' => 'log_user',
4193 ),
4194 ),
4195 ),
4196 'wrapper' => array(
4197 'width' => '',
4198 'class' => '',
4199 'id' => '',
4200 ),
4201 'acfe_permissions' => '',
4202 ),
4203 array(
4204 'key' => 'field_acfe_form_user_save_password',
4205 'label' => 'Password',
4206 'name' => 'acfe_form_user_save_password',
4207 'type' => 'select',
4208 'instructions' => '',
4209 'required' => 0,
4210 'wrapper' => array(
4211 'width' => '',
4212 'class' => '',
4213 'id' => '',
4214 ),
4215 'acfe_permissions' => '',
4216 'choices' => array(
4217 'generate_password' => 'Generate password',
4218 ),
4219 'default_value' => array(
4220 ),
4221 'allow_null' => 1,
4222 'multiple' => 0,
4223 'ui' => 1,
4224 'return_format' => 'value',
4225 'placeholder' => 'Default',
4226 'ajax' => 0,
4227 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4228 'allow_custom' => 1,
4229 'conditional_logic' => array(
4230 array(
4231 array(
4232 'field' => 'field_acfe_form_user_map_password',
4233 'operator' => '==empty',
4234 ),
4235 array(
4236 'field' => 'field_acfe_form_user_action',
4237 'operator' => '!=',
4238 'value' => 'log_user',
4239 ),
4240 ),
4241 ),
4242 ),
4243 array(
4244 'key' => 'field_acfe_form_user_map_password_message',
4245 'label' => 'Password',
4246 'name' => 'acfe_form_user_map_password_message',
4247 'type' => 'acfe_dynamic_render',
4248 'instructions' => '',
4249 'required' => 0,
4250 'conditional_logic' => array(
4251 array(
4252 array(
4253 'field' => 'field_acfe_form_user_map_password',
4254 'operator' => '!=empty',
4255 ),
4256 array(
4257 'field' => 'field_acfe_form_user_action',
4258 'operator' => '!=',
4259 'value' => 'log_user',
4260 ),
4261 ),
4262 ),
4263 'wrapper' => array(
4264 'width' => '',
4265 'class' => '',
4266 'id' => '',
4267 ),
4268 'acfe_permissions' => '',
4269 ),
4270 array(
4271 'key' => 'field_acfe_form_user_save_first_name',
4272 'label' => 'First name',
4273 'name' => 'acfe_form_user_save_first_name',
4274 'type' => 'select',
4275 'instructions' => '',
4276 'required' => 0,
4277 'wrapper' => array(
4278 'width' => '',
4279 'class' => '',
4280 'id' => '',
4281 ),
4282 'acfe_permissions' => '',
4283 'choices' => array(),
4284 'default_value' => array(
4285 ),
4286 'allow_null' => 1,
4287 'multiple' => 0,
4288 'ui' => 1,
4289 'return_format' => 'value',
4290 'placeholder' => 'Default',
4291 'ajax' => 0,
4292 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4293 'allow_custom' => 1,
4294 'conditional_logic' => array(
4295 array(
4296 array(
4297 'field' => 'field_acfe_form_user_map_first_name',
4298 'operator' => '==empty',
4299 ),
4300 array(
4301 'field' => 'field_acfe_form_user_action',
4302 'operator' => '!=',
4303 'value' => 'log_user',
4304 ),
4305 ),
4306 ),
4307 ),
4308 array(
4309 'key' => 'field_acfe_form_user_map_first_name_message',
4310 'label' => 'First name',
4311 'name' => 'acfe_form_user_map_first_name_message',
4312 'type' => 'acfe_dynamic_render',
4313 'instructions' => '',
4314 'required' => 0,
4315 'conditional_logic' => array(
4316 array(
4317 array(
4318 'field' => 'field_acfe_form_user_map_first_name',
4319 'operator' => '!=empty',
4320 ),
4321 array(
4322 'field' => 'field_acfe_form_user_action',
4323 'operator' => '!=',
4324 'value' => 'log_user',
4325 ),
4326 ),
4327 ),
4328 'wrapper' => array(
4329 'width' => '',
4330 'class' => '',
4331 'id' => '',
4332 ),
4333 'acfe_permissions' => '',
4334 ),
4335 array(
4336 'key' => 'field_acfe_form_user_save_last_name',
4337 'label' => 'Last name',
4338 'name' => 'acfe_form_user_save_last_name',
4339 'type' => 'select',
4340 'instructions' => '',
4341 'required' => 0,
4342 'wrapper' => array(
4343 'width' => '',
4344 'class' => '',
4345 'id' => '',
4346 ),
4347 'acfe_permissions' => '',
4348 'choices' => array(),
4349 'default_value' => array(),
4350 'allow_null' => 1,
4351 'multiple' => 0,
4352 'ui' => 1,
4353 'return_format' => 'value',
4354 'placeholder' => 'Default',
4355 'ajax' => 0,
4356 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4357 'allow_custom' => 1,
4358 'conditional_logic' => array(
4359 array(
4360 array(
4361 'field' => 'field_acfe_form_user_map_last_name',
4362 'operator' => '==empty',
4363 ),
4364 array(
4365 'field' => 'field_acfe_form_user_action',
4366 'operator' => '!=',
4367 'value' => 'log_user',
4368 ),
4369 ),
4370 ),
4371 ),
4372 array(
4373 'key' => 'field_acfe_form_user_map_last_name_message',
4374 'label' => 'Last name',
4375 'name' => 'acfe_form_user_map_last_name_message',
4376 'type' => 'acfe_dynamic_render',
4377 'instructions' => '',
4378 'required' => 0,
4379 'conditional_logic' => array(
4380 array(
4381 array(
4382 'field' => 'field_acfe_form_user_map_last_name',
4383 'operator' => '!=empty',
4384 ),
4385 array(
4386 'field' => 'field_acfe_form_user_action',
4387 'operator' => '!=',
4388 'value' => 'log_user',
4389 ),
4390 ),
4391 ),
4392 'wrapper' => array(
4393 'width' => '',
4394 'class' => '',
4395 'id' => '',
4396 ),
4397 'acfe_permissions' => '',
4398 ),
4399 array(
4400 'key' => 'field_acfe_form_user_save_nickname',
4401 'label' => 'Nickname',
4402 'name' => 'acfe_form_user_save_nickname',
4403 'type' => 'select',
4404 'instructions' => '',
4405 'required' => 0,
4406 'wrapper' => array(
4407 'width' => '',
4408 'class' => '',
4409 'id' => '',
4410 ),
4411 'acfe_permissions' => '',
4412 'choices' => array(),
4413 'default_value' => array(
4414 ),
4415 'allow_null' => 1,
4416 'multiple' => 0,
4417 'ui' => 1,
4418 'return_format' => 'value',
4419 'placeholder' => 'Default',
4420 'ajax' => 0,
4421 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4422 'allow_custom' => 1,
4423 'conditional_logic' => array(
4424 array(
4425 array(
4426 'field' => 'field_acfe_form_user_map_nickname',
4427 'operator' => '==empty',
4428 ),
4429 array(
4430 'field' => 'field_acfe_form_user_action',
4431 'operator' => '!=',
4432 'value' => 'log_user',
4433 ),
4434 ),
4435 ),
4436 ),
4437 array(
4438 'key' => 'field_acfe_form_user_map_nickname_message',
4439 'label' => 'Nickname',
4440 'name' => 'acfe_form_user_map_nickname_message',
4441 'type' => 'acfe_dynamic_render',
4442 'instructions' => '',
4443 'required' => 0,
4444 'conditional_logic' => array(
4445 array(
4446 array(
4447 'field' => 'field_acfe_form_user_map_nickname',
4448 'operator' => '!=empty',
4449 ),
4450 array(
4451 'field' => 'field_acfe_form_user_action',
4452 'operator' => '!=',
4453 'value' => 'log_user',
4454 ),
4455 ),
4456 ),
4457 'wrapper' => array(
4458 'width' => '',
4459 'class' => '',
4460 'id' => '',
4461 ),
4462 'acfe_permissions' => '',
4463 ),
4464 array(
4465 'key' => 'field_acfe_form_user_save_display_name',
4466 'label' => 'Display name',
4467 'name' => 'acfe_form_user_save_display_name',
4468 'type' => 'select',
4469 'instructions' => '',
4470 'required' => 0,
4471 'wrapper' => array(
4472 'width' => '',
4473 'class' => '',
4474 'id' => '',
4475 ),
4476 'acfe_permissions' => '',
4477 'choices' => array(),
4478 'default_value' => array(
4479 ),
4480 'allow_null' => 1,
4481 'multiple' => 0,
4482 'ui' => 1,
4483 'return_format' => 'value',
4484 'placeholder' => 'Default',
4485 'ajax' => 0,
4486 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4487 'allow_custom' => 1,
4488 'conditional_logic' => array(
4489 array(
4490 array(
4491 'field' => 'field_acfe_form_user_map_display_name',
4492 'operator' => '==empty',
4493 ),
4494 array(
4495 'field' => 'field_acfe_form_user_action',
4496 'operator' => '!=',
4497 'value' => 'log_user',
4498 ),
4499 ),
4500 ),
4501 ),
4502 array(
4503 'key' => 'field_acfe_form_user_map_display_name_message',
4504 'label' => 'Display name',
4505 'name' => 'acfe_form_user_map_display_name_message',
4506 'type' => 'acfe_dynamic_render',
4507 'instructions' => '',
4508 'required' => 0,
4509 'conditional_logic' => array(
4510 array(
4511 array(
4512 'field' => 'field_acfe_form_user_map_display_name',
4513 'operator' => '!=empty',
4514 ),
4515 array(
4516 'field' => 'field_acfe_form_user_action',
4517 'operator' => '!=',
4518 'value' => 'log_user',
4519 ),
4520 ),
4521 ),
4522 'wrapper' => array(
4523 'width' => '',
4524 'class' => '',
4525 'id' => '',
4526 ),
4527 'acfe_permissions' => '',
4528 ),
4529 array(
4530 'key' => 'field_acfe_form_user_save_website',
4531 'label' => 'Website',
4532 'name' => 'acfe_form_user_save_website',
4533 'type' => 'select',
4534 'instructions' => '',
4535 'required' => 0,
4536 'wrapper' => array(
4537 'width' => '',
4538 'class' => '',
4539 'id' => '',
4540 ),
4541 'acfe_permissions' => '',
4542 'choices' => array(),
4543 'default_value' => array(
4544 ),
4545 'allow_null' => 1,
4546 'multiple' => 0,
4547 'ui' => 1,
4548 'return_format' => 'value',
4549 'placeholder' => 'Default',
4550 'ajax' => 0,
4551 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4552 'allow_custom' => 1,
4553 'conditional_logic' => array(
4554 array(
4555 array(
4556 'field' => 'field_acfe_form_user_map_website',
4557 'operator' => '==empty',
4558 ),
4559 array(
4560 'field' => 'field_acfe_form_user_action',
4561 'operator' => '!=',
4562 'value' => 'log_user',
4563 ),
4564 ),
4565 ),
4566 ),
4567 array(
4568 'key' => 'field_acfe_form_user_map_website_message',
4569 'label' => 'Website',
4570 'name' => 'acfe_form_user_map_website_message',
4571 'type' => 'acfe_dynamic_render',
4572 'instructions' => '',
4573 'required' => 0,
4574 'conditional_logic' => array(
4575 array(
4576 array(
4577 'field' => 'field_acfe_form_user_map_website',
4578 'operator' => '!=empty',
4579 ),
4580 array(
4581 'field' => 'field_acfe_form_user_action',
4582 'operator' => '!=',
4583 'value' => 'log_user',
4584 ),
4585 ),
4586 ),
4587 'wrapper' => array(
4588 'width' => '',
4589 'class' => '',
4590 'id' => '',
4591 ),
4592 'acfe_permissions' => '',
4593 ),
4594 array(
4595 'key' => 'field_acfe_form_user_save_description_group',
4596 'label' => 'Description',
4597 'name' => 'acfe_form_user_save_description_group',
4598 'type' => 'group',
4599 'instructions' => '',
4600 'required' => 0,
4601 'conditional_logic' => array(
4602 array(
4603 array(
4604 'field' => 'field_acfe_form_user_map_description',
4605 'operator' => '==empty',
4606 ),
4607 array(
4608 'field' => 'field_acfe_form_user_action',
4609 'operator' => '!=',
4610 'value' => 'log_user',
4611 ),
4612 ),
4613 ),
4614 'wrapper' => array(
4615 'width' => '',
4616 'class' => '',
4617 'id' => '',
4618 ),
4619 'acfe_permissions' => '',
4620 'layout' => 'block',
4621 'acfe_seamless_style' => true,
4622 'acfe_group_modal' => 0,
4623 'sub_fields' => array(
4624 array(
4625 'key' => 'field_acfe_form_user_save_description',
4626 'label' => '',
4627 'name' => 'acfe_form_user_save_description',
4628 'type' => 'select',
4629 'instructions' => '',
4630 'required' => 0,
4631 'conditional_logic' => 0,
4632 'wrapper' => array(
4633 'width' => '',
4634 'class' => '',
4635 'id' => '',
4636 ),
4637 'acfe_permissions' => '',
4638 'choices' => array(
4639 'custom' => 'WYSIWYG Editor',
4640 ),
4641 'default_value' => array(
4642 ),
4643 'allow_null' => 1,
4644 'multiple' => 0,
4645 'ui' => 1,
4646 'return_format' => 'value',
4647 'placeholder' => 'Default',
4648 'ajax' => 0,
4649 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4650 'allow_custom' => 1,
4651 ),
4652 array(
4653 'key' => 'field_acfe_form_user_save_description_custom',
4654 'label' => '',
4655 'name' => 'acfe_form_user_save_description_custom',
4656 'type' => 'wysiwyg',
4657 'instructions' => '',
4658 'required' => 1,
4659 'conditional_logic' => array(
4660 array(
4661 array(
4662 'field' => 'field_acfe_form_user_save_description',
4663 'operator' => '==',
4664 'value' => 'custom',
4665 ),
4666 ),
4667 ),
4668 'wrapper' => array(
4669 'width' => '',
4670 'class' => '',
4671 'id' => '',
4672 ),
4673 'acfe_permissions' => '',
4674 'default_value' => '',
4675 'tabs' => 'all',
4676 'toolbar' => 'full',
4677 'media_upload' => 1,
4678 'delay' => 0,
4679 ),
4680 ),
4681 ),
4682 array(
4683 'key' => 'field_acfe_form_user_map_description_message',
4684 'label' => 'Description',
4685 'name' => 'acfe_form_user_map_description_message',
4686 'type' => 'acfe_dynamic_render',
4687 'instructions' => '',
4688 'required' => 0,
4689 'conditional_logic' => array(
4690 array(
4691 array(
4692 'field' => 'field_acfe_form_user_map_description',
4693 'operator' => '!=empty',
4694 ),
4695 array(
4696 'field' => 'field_acfe_form_user_action',
4697 'operator' => '!=',
4698 'value' => 'log_user',
4699 ),
4700 ),
4701 ),
4702 'wrapper' => array(
4703 'width' => '',
4704 'class' => '',
4705 'id' => '',
4706 ),
4707 'acfe_permissions' => '',
4708 ),
4709 array(
4710 'key' => 'field_acfe_form_user_save_role',
4711 'label' => 'Role',
4712 'name' => 'acfe_form_user_save_role',
4713 'type' => 'acfe_user_roles',
4714 'instructions' => '',
4715 'required' => 0,
4716 'conditional_logic' => array(
4717 array(
4718 array(
4719 'field' => 'field_acfe_form_user_map_role',
4720 'operator' => '==empty',
4721 ),
4722 array(
4723 'field' => 'field_acfe_form_user_action',
4724 'operator' => '!=',
4725 'value' => 'log_user',
4726 ),
4727 ),
4728 ),
4729 'wrapper' => array(
4730 'width' => '',
4731 'class' => '',
4732 'id' => '',
4733 ),
4734 'acfe_permissions' => '',
4735 'user_role' => '',
4736 'field_type' => 'select',
4737 'default_value' => '',
4738 'allow_null' => 1,
4739 'placeholder' => 'Default',
4740 'multiple' => 0,
4741 'ui' => 1,
4742 'choices' => array(
4743 ),
4744 'ajax' => 0,
4745 'layout' => '',
4746 'toggle' => 0,
4747 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4748 'allow_custom' => 1,
4749 ),
4750 array(
4751 'key' => 'field_acfe_form_user_map_role_message',
4752 'label' => 'Role',
4753 'name' => 'acfe_form_user_map_role_message',
4754 'type' => 'acfe_dynamic_render',
4755 'instructions' => '',
4756 'required' => 0,
4757 'conditional_logic' => array(
4758 array(
4759 array(
4760 'field' => 'field_acfe_form_user_map_role',
4761 'operator' => '!=empty',
4762 ),
4763 array(
4764 'field' => 'field_acfe_form_user_action',
4765 'operator' => '!=',
4766 'value' => 'log_user',
4767 ),
4768 ),
4769 ),
4770 'wrapper' => array(
4771 'width' => '',
4772 'class' => '',
4773 'id' => '',
4774 ),
4775 'acfe_permissions' => '',
4776 ),
4777 array(
4778 'key' => 'field_acfe_form_user_save_meta',
4779 'label' => 'Save ACF fields',
4780 'name' => 'acfe_form_user_save_meta',
4781 'type' => 'checkbox',
4782 'instructions' => 'Choose which ACF fields should be saved as metadata',
4783 'required' => 0,
4784 'wrapper' => array(
4785 'width' => '',
4786 'class' => '',
4787 'id' => '',
4788 ),
4789 'acfe_permissions' => '',
4790 'choices' => array(
4791 ),
4792 'allow_custom' => 0,
4793 'default_value' => array(
4794 ),
4795 'layout' => 'vertical',
4796 'toggle' => 1,
4797 'return_format' => 'value',
4798 'save_custom' => 0,
4799 'conditional_logic' => array(
4800 array(
4801 array(
4802 'field' => 'field_acfe_form_user_action',
4803 'operator' => '!=',
4804 'value' => 'log_user',
4805 ),
4806 ),
4807 ),
4808 ),
4809
4810 /*
4811 * Layout: User Load
4812 */
4813 array(
4814 'key' => 'acfe_form_user_tab_load',
4815 'label' => 'Load',
4816 'name' => '',
4817 'type' => 'tab',
4818 'instructions' => '',
4819 'required' => 0,
4820 'wrapper' => array(
4821 'width' => '',
4822 'class' => '',
4823 'id' => '',
4824 ),
4825 'acfe_permissions' => '',
4826 'placement' => 'top',
4827 'endpoint' => 0,
4828 'conditional_logic' => array(
4829 array(
4830 array(
4831 'field' => 'field_acfe_form_user_action',
4832 'operator' => '!=',
4833 'value' => 'log_user',
4834 ),
4835 ),
4836 ),
4837 ),
4838 array(
4839 'key' => 'field_acfe_form_user_load_values',
4840 'label' => 'Load Values',
4841 'name' => 'acfe_form_user_load_values',
4842 'type' => 'true_false',
4843 'instructions' => 'Fill inputs with values',
4844 'required' => 0,
4845 'conditional_logic' => 0,
4846 'wrapper' => array(
4847 'width' => '',
4848 'class' => '',
4849 'id' => '',
4850 ),
4851 'acfe_permissions' => '',
4852 'message' => '',
4853 'default_value' => 0,
4854 'ui' => 1,
4855 'ui_on_text' => '',
4856 'ui_off_text' => '',
4857 ),
4858 array(
4859 'key' => 'field_acfe_form_user_load_source',
4860 'label' => 'Source',
4861 'name' => 'acfe_form_user_load_source',
4862 'type' => 'select',
4863 'instructions' => '',
4864 'required' => 0,
4865 'conditional_logic' => array(
4866 array(
4867 array(
4868 'field' => 'field_acfe_form_user_load_values',
4869 'operator' => '==',
4870 'value' => '1',
4871 ),
4872 ),
4873 ),
4874 'wrapper' => array(
4875 'width' => '',
4876 'class' => '',
4877 'id' => '',
4878 'data-instruction-placement' => 'field'
4879 ),
4880 'acfe_permissions' => '',
4881 'choices' => array(
4882 ),
4883 'default_value' => 'current_user',
4884 'allow_null' => 0,
4885 'multiple' => 0,
4886 'ui' => 1,
4887 'ajax' => 0,
4888 'return_format' => 'value',
4889 'placeholder' => '',
4890 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4891 'allow_custom' => 1,
4892 ),
4893
4894 array(
4895 'key' => 'field_acfe_form_user_map_email',
4896 'label' => 'Email',
4897 'name' => 'acfe_form_user_map_email',
4898 'type' => 'select',
4899 'instructions' => '',
4900 'required' => 0,
4901 'wrapper' => array(
4902 'width' => '',
4903 'class' => '',
4904 'id' => '',
4905 ),
4906 'acfe_permissions' => '',
4907 'choices' => array(
4908 ),
4909 'default_value' => array(
4910 ),
4911 'allow_null' => 1,
4912 'multiple' => 0,
4913 'ui' => 1,
4914 'return_format' => 'value',
4915 'placeholder' => 'Default',
4916 'ajax' => 0,
4917 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4918 'allow_custom' => 1,
4919 'conditional_logic' => array(
4920 array(
4921 array(
4922 'field' => 'field_acfe_form_user_load_values',
4923 'operator' => '==',
4924 'value' => '1',
4925 ),
4926 array(
4927 'field' => 'field_acfe_form_user_action',
4928 'operator' => '!=',
4929 'value' => 'log_user',
4930 ),
4931 ),
4932 ),
4933 ),
4934 array(
4935 'key' => 'field_acfe_form_user_map_username',
4936 'label' => 'Username',
4937 'name' => 'acfe_form_user_map_username',
4938 'type' => 'select',
4939 'instructions' => '',
4940 'required' => 0,
4941 'wrapper' => array(
4942 'width' => '',
4943 'class' => '',
4944 'id' => '',
4945 ),
4946 'acfe_permissions' => '',
4947 'choices' => array(
4948 ),
4949 'default_value' => array(
4950 ),
4951 'allow_null' => 1,
4952 'multiple' => 0,
4953 'ui' => 1,
4954 'return_format' => 'value',
4955 'placeholder' => 'Default',
4956 'ajax' => 0,
4957 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4958 'allow_custom' => 1,
4959 'conditional_logic' => array(
4960 array(
4961 array(
4962 'field' => 'field_acfe_form_user_load_values',
4963 'operator' => '==',
4964 'value' => '1',
4965 ),
4966 array(
4967 'field' => 'field_acfe_form_user_action',
4968 'operator' => '!=',
4969 'value' => 'log_user',
4970 ),
4971 ),
4972 ),
4973 ),
4974 array(
4975 'key' => 'field_acfe_form_user_map_password',
4976 'label' => 'Password',
4977 'name' => 'acfe_form_user_map_password',
4978 'type' => 'select',
4979 'instructions' => '',
4980 'required' => 0,
4981 'wrapper' => array(
4982 'width' => '',
4983 'class' => '',
4984 'id' => '',
4985 ),
4986 'acfe_permissions' => '',
4987 'choices' => array(
4988 ),
4989 'default_value' => array(
4990 ),
4991 'allow_null' => 1,
4992 'multiple' => 0,
4993 'ui' => 1,
4994 'return_format' => 'value',
4995 'placeholder' => 'Default',
4996 'ajax' => 0,
4997 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
4998 'allow_custom' => 1,
4999 'conditional_logic' => array(
5000 array(
5001 array(
5002 'field' => 'field_acfe_form_user_load_values',
5003 'operator' => '==',
5004 'value' => '1',
5005 ),
5006 array(
5007 'field' => 'field_acfe_form_user_action',
5008 'operator' => '!=',
5009 'value' => 'log_user',
5010 ),
5011 ),
5012 ),
5013 ),
5014 array(
5015 'key' => 'field_acfe_form_user_map_first_name',
5016 'label' => 'First name',
5017 'name' => 'acfe_form_user_map_first_name',
5018 'type' => 'select',
5019 'instructions' => '',
5020 'required' => 0,
5021 'wrapper' => array(
5022 'width' => '',
5023 'class' => '',
5024 'id' => '',
5025 ),
5026 'acfe_permissions' => '',
5027 'choices' => array(
5028 ),
5029 'default_value' => array(
5030 ),
5031 'allow_null' => 1,
5032 'multiple' => 0,
5033 'ui' => 1,
5034 'return_format' => 'value',
5035 'placeholder' => 'Default',
5036 'ajax' => 0,
5037 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5038 'allow_custom' => 1,
5039 'conditional_logic' => array(
5040 array(
5041 array(
5042 'field' => 'field_acfe_form_user_load_values',
5043 'operator' => '==',
5044 'value' => '1',
5045 ),
5046 array(
5047 'field' => 'field_acfe_form_user_action',
5048 'operator' => '!=',
5049 'value' => 'log_user',
5050 ),
5051 ),
5052 ),
5053 ),
5054 array(
5055 'key' => 'field_acfe_form_user_map_last_name',
5056 'label' => 'Last name',
5057 'name' => 'acfe_form_user_map_last_name',
5058 'type' => 'select',
5059 'instructions' => '',
5060 'required' => 0,
5061 'wrapper' => array(
5062 'width' => '',
5063 'class' => '',
5064 'id' => '',
5065 ),
5066 'acfe_permissions' => '',
5067 'choices' => array(
5068 ),
5069 'default_value' => array(
5070 ),
5071 'allow_null' => 1,
5072 'multiple' => 0,
5073 'ui' => 1,
5074 'return_format' => 'value',
5075 'placeholder' => 'Default',
5076 'ajax' => 0,
5077 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5078 'allow_custom' => 1,
5079 'conditional_logic' => array(
5080 array(
5081 array(
5082 'field' => 'field_acfe_form_user_load_values',
5083 'operator' => '==',
5084 'value' => '1',
5085 ),
5086 array(
5087 'field' => 'field_acfe_form_user_action',
5088 'operator' => '!=',
5089 'value' => 'log_user',
5090 ),
5091 ),
5092 ),
5093 ),
5094 array(
5095 'key' => 'field_acfe_form_user_map_nickname',
5096 'label' => 'Nickname',
5097 'name' => 'acfe_form_user_map_nickname',
5098 'type' => 'select',
5099 'instructions' => '',
5100 'required' => 0,
5101 'wrapper' => array(
5102 'width' => '',
5103 'class' => '',
5104 'id' => '',
5105 ),
5106 'acfe_permissions' => '',
5107 'choices' => array(
5108 ),
5109 'default_value' => array(
5110 ),
5111 'allow_null' => 1,
5112 'multiple' => 0,
5113 'ui' => 1,
5114 'return_format' => 'value',
5115 'placeholder' => 'Default',
5116 'ajax' => 0,
5117 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5118 'allow_custom' => 1,
5119 'conditional_logic' => array(
5120 array(
5121 array(
5122 'field' => 'field_acfe_form_user_load_values',
5123 'operator' => '==',
5124 'value' => '1',
5125 ),
5126 array(
5127 'field' => 'field_acfe_form_user_action',
5128 'operator' => '!=',
5129 'value' => 'log_user',
5130 ),
5131 ),
5132 ),
5133 ),
5134 array(
5135 'key' => 'field_acfe_form_user_map_display_name',
5136 'label' => 'Display name',
5137 'name' => 'acfe_form_user_map_display_name',
5138 'type' => 'select',
5139 'instructions' => '',
5140 'required' => 0,
5141 'wrapper' => array(
5142 'width' => '',
5143 'class' => '',
5144 'id' => '',
5145 ),
5146 'acfe_permissions' => '',
5147 'choices' => array(
5148 ),
5149 'default_value' => array(
5150 ),
5151 'allow_null' => 1,
5152 'multiple' => 0,
5153 'ui' => 1,
5154 'return_format' => 'value',
5155 'placeholder' => 'Default',
5156 'ajax' => 0,
5157 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5158 'allow_custom' => 1,
5159 'conditional_logic' => array(
5160 array(
5161 array(
5162 'field' => 'field_acfe_form_user_load_values',
5163 'operator' => '==',
5164 'value' => '1',
5165 ),
5166 array(
5167 'field' => 'field_acfe_form_user_action',
5168 'operator' => '!=',
5169 'value' => 'log_user',
5170 ),
5171 ),
5172 ),
5173 ),
5174 array(
5175 'key' => 'field_acfe_form_user_map_website',
5176 'label' => 'Website',
5177 'name' => 'acfe_form_user_map_website',
5178 'type' => 'select',
5179 'instructions' => '',
5180 'required' => 0,
5181 'wrapper' => array(
5182 'width' => '',
5183 'class' => '',
5184 'id' => '',
5185 ),
5186 'acfe_permissions' => '',
5187 'choices' => array(
5188 ),
5189 'default_value' => array(
5190 ),
5191 'allow_null' => 1,
5192 'multiple' => 0,
5193 'ui' => 1,
5194 'return_format' => 'value',
5195 'placeholder' => 'Default',
5196 'ajax' => 0,
5197 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5198 'allow_custom' => 1,
5199 'conditional_logic' => array(
5200 array(
5201 array(
5202 'field' => 'field_acfe_form_user_load_values',
5203 'operator' => '==',
5204 'value' => '1',
5205 ),
5206 array(
5207 'field' => 'field_acfe_form_user_action',
5208 'operator' => '!=',
5209 'value' => 'log_user',
5210 ),
5211 ),
5212 ),
5213 ),
5214 array(
5215 'key' => 'field_acfe_form_user_map_description',
5216 'label' => 'Description',
5217 'name' => 'acfe_form_user_map_description',
5218 'type' => 'select',
5219 'instructions' => '',
5220 'required' => 0,
5221 'wrapper' => array(
5222 'width' => '',
5223 'class' => '',
5224 'id' => '',
5225 ),
5226 'acfe_permissions' => '',
5227 'choices' => array(
5228 ),
5229 'default_value' => array(
5230 ),
5231 'allow_null' => 1,
5232 'multiple' => 0,
5233 'ui' => 1,
5234 'return_format' => 'value',
5235 'placeholder' => 'Default',
5236 'ajax' => 0,
5237 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5238 'allow_custom' => 1,
5239 'conditional_logic' => array(
5240 array(
5241 array(
5242 'field' => 'field_acfe_form_user_load_values',
5243 'operator' => '==',
5244 'value' => '1',
5245 ),
5246 array(
5247 'field' => 'field_acfe_form_user_action',
5248 'operator' => '!=',
5249 'value' => 'log_user',
5250 ),
5251 ),
5252 ),
5253 ),
5254 array(
5255 'key' => 'field_acfe_form_user_map_role',
5256 'label' => 'Role',
5257 'name' => 'acfe_form_user_map_role',
5258 'type' => 'select',
5259 'instructions' => '',
5260 'required' => 0,
5261 'wrapper' => array(
5262 'width' => '',
5263 'class' => '',
5264 'id' => '',
5265 ),
5266 'acfe_permissions' => '',
5267 'choices' => array(
5268 ),
5269 'default_value' => array(
5270 ),
5271 'allow_null' => 1,
5272 'multiple' => 0,
5273 'ui' => 1,
5274 'return_format' => 'value',
5275 'placeholder' => 'Default',
5276 'ajax' => 0,
5277 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5278 'allow_custom' => 1,
5279 'conditional_logic' => array(
5280 array(
5281 array(
5282 'field' => 'field_acfe_form_user_load_values',
5283 'operator' => '==',
5284 'value' => '1',
5285 ),
5286 array(
5287 'field' => 'field_acfe_form_user_action',
5288 'operator' => '!=',
5289 'value' => 'log_user',
5290 ),
5291 ),
5292 ),
5293 ),
5294 array(
5295 'key' => 'field_acfe_form_user_load_meta',
5296 'label' => 'Load ACF fields',
5297 'name' => 'acfe_form_user_load_meta',
5298 'type' => 'checkbox',
5299 'instructions' => 'Choose which ACF fields should have their values loaded',
5300 'required' => 0,
5301 'conditional_logic' => array(
5302 array(
5303 array(
5304 'field' => 'field_acfe_form_user_load_values',
5305 'operator' => '==',
5306 'value' => '1',
5307 ),
5308 ),
5309 ),
5310 'wrapper' => array(
5311 'width' => '',
5312 'class' => '',
5313 'id' => '',
5314 ),
5315 'acfe_permissions' => '',
5316 'choices' => array(
5317 ),
5318 'allow_custom' => 0,
5319 'default_value' => array(
5320 ),
5321 'layout' => 'vertical',
5322 'toggle' => 1,
5323 'return_format' => 'value',
5324 'save_custom' => 0,
5325 ),
5326
5327 ),
5328 'min' => '',
5329 'max' => '',
5330 );
5331
5332 $layouts['layout_option'] = array(
5333 'key' => 'layout_option',
5334 'name' => 'option',
5335 'label' => 'Option action',
5336 'display' => 'row',
5337 'sub_fields' => array(
5338
5339 /*
5340 * Documentation
5341 */
5342 array(
5343 'key' => 'field_acfe_form_options_action_docs',
5344 'label' => '',
5345 'name' => 'acfe_form_action_docs',
5346 'type' => 'acfe_dynamic_render',
5347 'instructions' => '',
5348 'required' => 0,
5349 'conditional_logic' => 0,
5350 'wrapper' => array(
5351 'width' => '',
5352 'class' => '',
5353 'id' => '',
5354 ),
5355 'render' => function(){
5356 echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/option-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
5357 }
5358 ),
5359
5360 /*
5361 * Layout: Option Action
5362 */
5363 array(
5364 'key' => 'field_acfe_form_option_tab_action',
5365 'label' => 'Action',
5366 'name' => '',
5367 'type' => 'tab',
5368 'instructions' => '',
5369 'required' => 0,
5370 'conditional_logic' => 0,
5371 'wrapper' => array(
5372 'width' => '',
5373 'class' => '',
5374 'id' => '',
5375 'data-no-preference' => true,
5376 ),
5377 'acfe_permissions' => '',
5378 'placement' => 'top',
5379 'endpoint' => 0,
5380 ),
5381 array(
5382 'key' => 'field_acfe_form_option_custom_alias',
5383 'label' => 'Action name',
5384 'name' => 'acfe_form_custom_alias',
5385 'type' => 'acfe_slug',
5386 'instructions' => '(Optional) Target this action using hooks.',
5387 'required' => 0,
5388 'conditional_logic' => 0,
5389 'wrapper' => array(
5390 'width' => '',
5391 'class' => '',
5392 'id' => '',
5393 'data-instruction-placement' => 'field'
5394 ),
5395 'acfe_permissions' => '',
5396 'default_value' => '',
5397 'placeholder' => 'Option',
5398 'prepend' => '',
5399 'append' => '',
5400 'maxlength' => '',
5401 ),
5402
5403 /*
5404 * Layout: Option Save
5405 */
5406 array(
5407 'key' => 'field_acfe_form_option_tab_save',
5408 'label' => 'Save',
5409 'name' => '',
5410 'type' => 'tab',
5411 'instructions' => '',
5412 'required' => 0,
5413 'conditional_logic' => 0,
5414 'wrapper' => array(
5415 'width' => '',
5416 'class' => '',
5417 'id' => '',
5418 ),
5419 'acfe_permissions' => '',
5420 'placement' => 'top',
5421 'endpoint' => 0,
5422 ),
5423 array(
5424 'key' => 'field_acfe_form_option_save_target',
5425 'label' => 'Target',
5426 'name' => 'acfe_form_option_save_target',
5427 'type' => 'select',
5428 'instructions' => '',
5429 'required' => 0,
5430 'conditional_logic' => array(),
5431 'wrapper' => array(
5432 'width' => '',
5433 'class' => '',
5434 'id' => '',
5435 'data-instruction-placement' => 'field'
5436 ),
5437 'acfe_permissions' => '',
5438 'choices' => array(
5439 ),
5440 'default_value' => '',
5441 'allow_null' => 0,
5442 'multiple' => 0,
5443 'ui' => 1,
5444 'ajax' => 0,
5445 'return_format' => 'value',
5446 'placeholder' => '',
5447 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5448 'allow_custom' => 1,
5449 ),
5450 array(
5451 'key' => 'field_acfe_form_option_save_meta',
5452 'label' => 'Save ACF fields',
5453 'name' => 'acfe_form_option_save_meta',
5454 'type' => 'checkbox',
5455 'instructions' => 'Choose which ACF fields should be saved as metadata',
5456 'required' => 0,
5457 'conditional_logic' => 0,
5458 'wrapper' => array(
5459 'width' => '',
5460 'class' => '',
5461 'id' => '',
5462 ),
5463 'acfe_permissions' => '',
5464 'choices' => array(
5465 ),
5466 'allow_custom' => 0,
5467 'default_value' => array(
5468 ),
5469 'layout' => 'vertical',
5470 'toggle' => 1,
5471 'return_format' => 'value',
5472 'save_custom' => 0,
5473 ),
5474
5475 /*
5476 * Layout: Option Load
5477 */
5478 array(
5479 'key' => 'acfe_form_option_tab_load',
5480 'label' => 'Load',
5481 'name' => '',
5482 'type' => 'tab',
5483 'instructions' => '',
5484 'required' => 0,
5485 'conditional_logic' => 0,
5486 'wrapper' => array(
5487 'width' => '',
5488 'class' => '',
5489 'id' => '',
5490 ),
5491 'acfe_permissions' => '',
5492 'placement' => 'top',
5493 'endpoint' => 0,
5494 ),
5495 array(
5496 'key' => 'field_acfe_form_option_load_values',
5497 'label' => 'Load Values',
5498 'name' => 'acfe_form_option_load_values',
5499 'type' => 'true_false',
5500 'instructions' => 'Fill inputs with values',
5501 'required' => 0,
5502 'conditional_logic' => 0,
5503 'wrapper' => array(
5504 'width' => '',
5505 'class' => '',
5506 'id' => '',
5507 ),
5508 'acfe_permissions' => '',
5509 'message' => '',
5510 'default_value' => 0,
5511 'ui' => 1,
5512 'ui_on_text' => '',
5513 'ui_off_text' => '',
5514 ),
5515 array(
5516 'key' => 'field_acfe_form_option_load_source',
5517 'label' => 'Source',
5518 'name' => 'acfe_form_option_load_source',
5519 'type' => 'select',
5520 'instructions' => '',
5521 'required' => 0,
5522 'conditional_logic' => array(
5523 array(
5524 array(
5525 'field' => 'field_acfe_form_option_load_values',
5526 'operator' => '==',
5527 'value' => '1',
5528 ),
5529 ),
5530 ),
5531 'wrapper' => array(
5532 'width' => '',
5533 'class' => '',
5534 'id' => '',
5535 'data-instruction-placement' => 'field'
5536 ),
5537 'acfe_permissions' => '',
5538 'choices' => array(
5539 ),
5540 'default_value' => '',
5541 'allow_null' => 0,
5542 'multiple' => 0,
5543 'ui' => 1,
5544 'ajax' => 0,
5545 'return_format' => 'value',
5546 'placeholder' => '',
5547 'search_placeholder' => 'Enter a custom value or template tag. (See "Cheatsheet" tab)',
5548 'allow_custom' => 1,
5549 ),
5550 array(
5551 'key' => 'field_acfe_form_option_load_meta',
5552 'label' => 'Load ACF fields',
5553 'name' => 'acfe_form_option_load_meta',
5554 'type' => 'checkbox',
5555 'instructions' => 'Choose which ACF fields should have their values loaded',
5556 'required' => 0,
5557 'conditional_logic' => array(
5558 array(
5559 array(
5560 'field' => 'field_acfe_form_option_load_values',
5561 'operator' => '==',
5562 'value' => '1',
5563 ),
5564 ),
5565 ),
5566 'wrapper' => array(
5567 'width' => '',
5568 'class' => '',
5569 'id' => '',
5570 ),
5571 'acfe_permissions' => '',
5572 'choices' => array(
5573 ),
5574 'allow_custom' => 0,
5575 'default_value' => array(
5576 ),
5577 'layout' => 'vertical',
5578 'toggle' => 1,
5579 'return_format' => 'value',
5580 'save_custom' => 0,
5581 ),
5582
5583 ),
5584 'min' => '',
5585 'max' => '',
5586 );
5587
5588 acf_add_local_field_group(array(
5589 'key' => 'group_acfe_dynamic_form',
5590 'title' => 'Dynamic Form',
5591 'acfe_display_title' => '',
5592 'fields' => array(
5593
5594 array(
5595 'key' => 'field_acfe_form_active',
5596 'label' => '',
5597 'name' => 'acfe_form_active',
5598 'type' => 'true_false',
5599 'instructions' => '',
5600 'required' => 0,
5601 'conditional_logic' => 0,
5602 'wrapper' => array(
5603 'width' => '',
5604 'class' => '',
5605 'id' => '',
5606 ),
5607 'message' => '',
5608 'default_value' => 1,
5609 'ui' => 1,
5610 'ui_on_text' => '',
5611 'ui_off_text' => '',
5612 ),
5613
5614 /*
5615 * Actions
5616 */
5617 array(
5618 'key' => 'field_acfe_form_tab_general',
5619 'label' => 'General',
5620 'name' => '',
5621 'type' => 'tab',
5622 'instructions' => '',
5623 'required' => 0,
5624 'conditional_logic' => 0,
5625 'wrapper' => array(
5626 'width' => '',
5627 'class' => '',
5628 'id' => '',
5629 'data-no-preference' => true,
5630 ),
5631 'acfe_permissions' => '',
5632 'placement' => 'top',
5633 'endpoint' => 0,
5634 ),
5635 array(
5636 'key' => 'field_acfe_form_name',
5637 'label' => 'Form name',
5638 'name' => 'acfe_form_name',
5639 'type' => 'acfe_slug',
5640 'instructions' => 'The unique form slug',
5641 'required' => 1,
5642 'conditional_logic' => 0,
5643 'wrapper' => array(
5644 'width' => '',
5645 'class' => '',
5646 'id' => '',
5647 ),
5648 'acfe_permissions' => '',
5649 'default_value' => '',
5650 'placeholder' => '',
5651 'prepend' => '',
5652 'append' => '',
5653 'maxlength' => '',
5654 ),
5655 array(
5656 'key' => 'field_acfe_form_field_groups',
5657 'label' => 'Field groups',
5658 'name' => 'acfe_form_field_groups',
5659 'type' => 'select',
5660 'instructions' => 'Render & map fields of the following field groups',
5661 'required' => 0,
5662 'conditional_logic' => 0,
5663 'wrapper' => array(
5664 'width' => '',
5665 'class' => '',
5666 'id' => '',
5667 ),
5668 'acfe_permissions' => '',
5669 'choices' => array(
5670 ),
5671 'default_value' => array(
5672 ),
5673 'allow_null' => 0,
5674 'multiple' => 1,
5675 'ui' => 1,
5676 'ajax' => 0,
5677 'return_format' => 'value',
5678 'placeholder' => '',
5679 ),
5680 array(
5681 'key' => 'field_acfe_form_actions',
5682 'label' => 'Actions',
5683 'name' => 'acfe_form_actions',
5684 'type' => 'flexible_content',
5685 'instructions' => 'Add actions on form submission',
5686 'required' => 0,
5687 'conditional_logic' => 0,
5688 'wrapper' => array(
5689 'width' => '',
5690 'class' => '',
5691 'id' => '',
5692 ),
5693 'acfe_flexible_stylised_button' => 1,
5694 'layouts' => $layouts,
5695 'button_label' => 'Add action',
5696 'min' => '',
5697 'max' => '',
5698 ),
5699
5700 /*
5701 * Settings
5702 */
5703 array(
5704 'key' => 'field_acfe_form_tab_settings',
5705 'label' => 'Settings',
5706 'name' => '',
5707 'type' => 'tab',
5708 'instructions' => '',
5709 'required' => 0,
5710 'conditional_logic' => 0,
5711 'wrapper' => array(
5712 'width' => '',
5713 'class' => '',
5714 'id' => '',
5715 ),
5716 'acfe_permissions' => '',
5717 'placement' => 'top',
5718 'endpoint' => 0,
5719 ),
5720 array(
5721 'key' => 'field_acfe_form_field_groups_rules',
5722 'label' => 'Field groups locations rules',
5723 'name' => 'acfe_form_field_groups_rules',
5724 'type' => 'true_false',
5725 'instructions' => 'Apply field groups locations rules for front-end display',
5726 'required' => 0,
5727 'wrapper' => array(
5728 'width' => '',
5729 'class' => '',
5730 'id' => '',
5731 ),
5732 'acfe_permissions' => '',
5733 'message' => '',
5734 'default_value' => 0,
5735 'ui' => 1,
5736 'ui_on_text' => '',
5737 'ui_off_text' => '',
5738 ),
5739 array(
5740 'key' => 'field_acfe_form_form_element',
5741 'label' => 'Form element',
5742 'name' => 'acfe_form_form_element',
5743 'type' => 'true_false',
5744 'instructions' => 'Whether or not to create a <code>&lt;form&gt;</code> element',
5745 'required' => 0,
5746 'conditional_logic' => 0,
5747 'wrapper' => array(
5748 'width' => '',
5749 'class' => '',
5750 'id' => '',
5751 ),
5752 'acfe_permissions' => '',
5753 'message' => '',
5754 'default_value' => 1,
5755 'ui' => 1,
5756 'ui_on_text' => '',
5757 'ui_off_text' => '',
5758 ),
5759 array(
5760 'key' => 'field_acfe_form_attributes',
5761 'label' => 'Form attributes',
5762 'name' => 'acfe_form_attributes',
5763 'type' => 'group',
5764 'instructions' => 'Form class and id',
5765 'required' => 0,
5766 'wrapper' => array(
5767 'width' => '',
5768 'class' => '',
5769 'id' => '',
5770 ),
5771 'acfe_permissions' => '',
5772 'layout' => 'block',
5773 'acfe_seamless_style' => true,
5774 'acfe_group_modal' => 0,
5775 'conditional_logic' => array(
5776 array(
5777 array(
5778 'field' => 'field_acfe_form_form_element',
5779 'operator' => '==',
5780 'value' => '1',
5781 ),
5782 ),
5783 ),
5784 'sub_fields' => array(
5785 array(
5786 'key' => 'field_acfe_form_attributes_class',
5787 'label' => '',
5788 'name' => 'acfe_form_attributes_class',
5789 'type' => 'text',
5790 'instructions' => '',
5791 'required' => 0,
5792 'conditional_logic' => array(),
5793 'wrapper' => array(
5794 'width' => '33',
5795 'class' => '',
5796 'id' => '',
5797 ),
5798 'acfe_permissions' => '',
5799 'default_value' => 'acf-form',
5800 'placeholder' => '',
5801 'prepend' => 'class',
5802 'append' => '',
5803 'maxlength' => '',
5804 ),
5805 array(
5806 'key' => 'field_acfe_form_attributes_id',
5807 'label' => '',
5808 'name' => 'acfe_form_attributes_id',
5809 'type' => 'text',
5810 'instructions' => '',
5811 'required' => 0,
5812 'conditional_logic' => array(),
5813 'wrapper' => array(
5814 'width' => '33',
5815 'class' => '',
5816 'id' => '',
5817 ),
5818 'acfe_permissions' => '',
5819 'default_value' => '',
5820 'placeholder' => '',
5821 'prepend' => 'id',
5822 'append' => '',
5823 'maxlength' => '',
5824 ),
5825
5826 ),
5827 ),
5828 array(
5829 'key' => 'field_acfe_form_fields_attributes',
5830 'label' => 'Fields class',
5831 'name' => 'acfe_form_fields_attributes',
5832 'type' => 'group',
5833 'instructions' => 'Add class to all fields',
5834 'required' => 0,
5835 'wrapper' => array(
5836 'width' => '',
5837 'class' => '',
5838 'id' => '',
5839 ),
5840 'acfe_permissions' => '',
5841 'layout' => 'block',
5842 'acfe_seamless_style' => true,
5843 'acfe_group_modal' => 0,
5844 'conditional_logic' => array(),
5845 'sub_fields' => array(
5846 array(
5847 'key' => 'field_acfe_form_fields_wrapper_class',
5848 'label' => '',
5849 'name' => 'acfe_form_fields_wrapper_class',
5850 'type' => 'text',
5851 'instructions' => '',
5852 'required' => 0,
5853 'conditional_logic' => array(),
5854 'wrapper' => array(
5855 'width' => '33',
5856 'class' => '',
5857 'id' => '',
5858 ),
5859 'acfe_permissions' => '',
5860 'default_value' => '',
5861 'placeholder' => '',
5862 'prepend' => 'wrapper class',
5863 'append' => '',
5864 'maxlength' => '',
5865 ),
5866 array(
5867 'key' => 'field_acfe_form_fields_class',
5868 'label' => '',
5869 'name' => 'acfe_form_fields_class',
5870 'type' => 'text',
5871 'instructions' => '',
5872 'required' => 0,
5873 'conditional_logic' => array(),
5874 'wrapper' => array(
5875 'width' => '33',
5876 'class' => '',
5877 'id' => '',
5878 ),
5879 'acfe_permissions' => '',
5880 'default_value' => '',
5881 'placeholder' => '',
5882 'prepend' => 'input class',
5883 'append' => '',
5884 'maxlength' => '',
5885 ),
5886 ),
5887 ),
5888 array(
5889 'key' => 'field_acfe_form_form_submit',
5890 'label' => 'Submit button',
5891 'name' => 'acfe_form_form_submit',
5892 'type' => 'true_false',
5893 'instructions' => 'Whether or not to create a form submit button. Defaults to true',
5894 'required' => 0,
5895 'conditional_logic' => 0,
5896 'wrapper' => array(
5897 'width' => '',
5898 'class' => '',
5899 'id' => '',
5900 ),
5901 'acfe_permissions' => '',
5902 'message' => '',
5903 'default_value' => 1,
5904 'ui' => 1,
5905 'ui_on_text' => '',
5906 'ui_off_text' => '',
5907 ),
5908 array(
5909 'key' => 'field_acfe_form_submit_value',
5910 'label' => 'Submit value',
5911 'name' => 'acfe_form_submit_value',
5912 'type' => 'text',
5913 'instructions' => 'The text displayed on the submit button',
5914 'required' => 0,
5915 'conditional_logic' => array(
5916 array(
5917 array(
5918 'field' => 'field_acfe_form_form_submit',
5919 'operator' => '==',
5920 'value' => '1',
5921 ),
5922 ),
5923 ),
5924 'wrapper' => array(
5925 'width' => '',
5926 'class' => '',
5927 'id' => '',
5928 ),
5929 'acfe_permissions' => '',
5930 'default_value' => 'Submit',
5931 'placeholder' => '',
5932 'prepend' => '',
5933 'append' => '',
5934 'maxlength' => '',
5935 ),
5936 array(
5937 'key' => 'field_acfe_form_html_submit_button',
5938 'label' => 'Submit button',
5939 'name' => 'acfe_form_html_submit_button',
5940 'type' => 'acfe_code_editor',
5941 'instructions' => 'HTML used to render the submit button.',
5942 'required' => 0,
5943 'conditional_logic' => array(
5944 array(
5945 array(
5946 'field' => 'field_acfe_form_form_submit',
5947 'operator' => '==',
5948 'value' => '1',
5949 ),
5950 ),
5951 ),
5952 'wrapper' => array(
5953 'width' => '',
5954 'class' => '',
5955 'id' => '',
5956 ),
5957 'acfe_permissions' => '',
5958 'default_value' => '<input type="submit" class="acf-button button button-primary button-large" value="%s" />',
5959 'placeholder' => '',
5960 'maxlength' => '',
5961 'rows' => 2,
5962 ),
5963 array(
5964 'key' => 'field_acfe_form_html_submit_spinner',
5965 'label' => 'Submit spinner',
5966 'name' => 'acfe_form_html_submit_spinner',
5967 'type' => 'acfe_code_editor',
5968 'instructions' => 'HTML used to render the submit button loading spinner.',
5969 'required' => 0,
5970 'conditional_logic' => array(
5971 array(
5972 array(
5973 'field' => 'field_acfe_form_form_submit',
5974 'operator' => '==',
5975 'value' => '1',
5976 ),
5977 ),
5978 ),
5979 'wrapper' => array(
5980 'width' => '',
5981 'class' => '',
5982 'id' => '',
5983 ),
5984 'acfe_permissions' => '',
5985 'default_value' => '<span class="acf-spinner"></span>',
5986 'placeholder' => '',
5987 'maxlength' => '',
5988 'rows' => 2,
5989 ),
5990 array(
5991 'key' => 'field_acfe_form_honeypot',
5992 'label' => 'Honeypot',
5993 'name' => 'acfe_form_honeypot',
5994 'type' => 'true_false',
5995 'instructions' => 'Whether to include a hidden input field to capture non human form submission. Defaults to true.',
5996 'required' => 0,
5997 'conditional_logic' => 0,
5998 'wrapper' => array(
5999 'width' => '',
6000 'class' => '',
6001 'id' => '',
6002 ),
6003 'acfe_permissions' => '',
6004 'message' => '',
6005 'default_value' => 1,
6006 'ui' => 1,
6007 'ui_on_text' => '',
6008 'ui_off_text' => '',
6009 ),
6010 array(
6011 'key' => 'field_acfe_form_kses',
6012 'label' => 'Kses',
6013 'name' => 'acfe_form_kses',
6014 'type' => 'true_false',
6015 'instructions' => 'Whether or not to sanitize all $_POST data with the wp_kses_post() function. Defaults to true.',
6016 'required' => 0,
6017 'conditional_logic' => 0,
6018 'wrapper' => array(
6019 'width' => '',
6020 'class' => '',
6021 'id' => '',
6022 ),
6023 'acfe_permissions' => '',
6024 'message' => '',
6025 'default_value' => 1,
6026 'ui' => 1,
6027 'ui_on_text' => '',
6028 'ui_off_text' => '',
6029 ),
6030 array(
6031 'key' => 'field_acfe_form_uploader',
6032 'label' => 'Uploader',
6033 'name' => 'acfe_form_uploader',
6034 'type' => 'radio',
6035 'instructions' => 'Whether to use the WP uploader or a basic input for image and file fields. Defaults to \'wp\'
6036 Choices of \'wp\' or \'basic\'.',
6037 'required' => 0,
6038 'conditional_logic' => 0,
6039 'wrapper' => array(
6040 'width' => '',
6041 'class' => '',
6042 'id' => '',
6043 ),
6044 'acfe_permissions' => '',
6045 'choices' => array(
6046 'default' => 'Default',
6047 'wp' => 'WordPress',
6048 'basic' => 'Browser',
6049 ),
6050 'allow_null' => 0,
6051 'other_choice' => 0,
6052 'default_value' => 'default',
6053 'layout' => 'vertical',
6054 'return_format' => 'value',
6055 'save_other_choice' => 0,
6056 ),
6057 array(
6058 'key' => 'field_acfe_form_form_field_el',
6059 'label' => 'Field element',
6060 'name' => 'acfe_form_form_field_el',
6061 'type' => 'radio',
6062 'instructions' => 'Determines element used to wrap a field. Defaults to \'div\'',
6063 'required' => 0,
6064 'conditional_logic' => 0,
6065 'wrapper' => array(
6066 'width' => '',
6067 'class' => '',
6068 'id' => '',
6069 ),
6070 'acfe_permissions' => '',
6071 'choices' => array(
6072 'div' => '&lt;div&gt;',
6073 'tr' => '&lt;tr&gt;',
6074 'td' => '&lt;td&gt;',
6075 'ul' => '&lt;ul&gt;',
6076 'ol' => '&lt;ol&gt;',
6077 'dl' => '&lt;dl&gt;',
6078 ),
6079 'allow_null' => 0,
6080 'other_choice' => 0,
6081 'default_value' => 'div',
6082 'layout' => 'vertical',
6083 'return_format' => 'value',
6084 'save_other_choice' => 0,
6085 ),
6086 array(
6087 'key' => 'field_acfe_form_label_placement',
6088 'label' => 'Label placement',
6089 'name' => 'acfe_form_label_placement',
6090 'type' => 'radio',
6091 'instructions' => 'Determines where field labels are places in relation to fields. Defaults to \'top\'. <br />
6092 Choices of \'top\' (Above fields) or \'left\' (Beside fields)',
6093 'required' => 0,
6094 'conditional_logic' => 0,
6095 'wrapper' => array(
6096 'width' => '',
6097 'class' => '',
6098 'id' => '',
6099 ),
6100 'acfe_permissions' => '',
6101 'choices' => array(
6102 'top' => 'Top',
6103 'left' => 'Left',
6104 'hidden' => 'Hidden',
6105 ),
6106 'allow_null' => 0,
6107 'other_choice' => 0,
6108 'default_value' => 'top',
6109 'layout' => 'vertical',
6110 'return_format' => 'value',
6111 'save_other_choice' => 0,
6112 ),
6113 array(
6114 'key' => 'field_acfe_form_instruction_placement',
6115 'label' => 'Instruction placement',
6116 'name' => 'acfe_form_instruction_placement',
6117 'type' => 'radio',
6118 'instructions' => 'Determines where field instructions are places in relation to fields. Defaults to \'label\'. <br />
6119 Choices of \'label\' (Below labels) or \'field\' (Below fields)',
6120 'required' => 0,
6121 'conditional_logic' => 0,
6122 'wrapper' => array(
6123 'width' => '',
6124 'class' => '',
6125 'id' => '',
6126 ),
6127 'acfe_permissions' => '',
6128 'choices' => array(
6129 'label' => 'Label',
6130 'field' => 'Field',
6131 ),
6132 'allow_null' => 0,
6133 'other_choice' => 0,
6134 'default_value' => 'label',
6135 'layout' => 'vertical',
6136 'return_format' => 'value',
6137 'save_other_choice' => 0,
6138 ),
6139
6140 /*
6141 * HTML
6142 */
6143 array(
6144 'key' => 'field_acfe_form_tab_html',
6145 'label' => 'HTML',
6146 'name' => '',
6147 'type' => 'tab',
6148 'instructions' => '',
6149 'required' => 0,
6150 'conditional_logic' => 0,
6151 'wrapper' => array(
6152 'width' => '',
6153 'class' => '',
6154 'id' => '',
6155 ),
6156 'acfe_permissions' => '',
6157 'placement' => 'top',
6158 'endpoint' => 0,
6159 ),
6160 array(
6161 'key' => 'field_acfe_form_custom_html_enable',
6162 'label' => 'Override Form render',
6163 'name' => 'acfe_form_custom_html_enable',
6164 'type' => 'true_false',
6165 'instructions' => 'Override the native field groups HTML render',
6166 'required' => 0,
6167 'conditional_logic' => 0,
6168 'wrapper' => array(
6169 'width' => '',
6170 'class' => '',
6171 'id' => '',
6172 ),
6173 'acfe_permissions' => '',
6174 'message' => '',
6175 'default_value' => false,
6176 'ui' => 1,
6177 'ui_on_text' => '',
6178 'ui_off_text' => '',
6179 ),
6180 array(
6181 'key' => 'field_acfe_form_html_before_fields',
6182 'label' => 'HTML Before render',
6183 'name' => 'acfe_form_html_before_fields',
6184 'type' => 'acfe_code_editor',
6185 'instructions' => 'Extra HTML to add before the fields',
6186 'required' => 0,
6187 'conditional_logic' => 0,
6188 'wrapper' => array(
6189 'width' => '',
6190 'class' => '',
6191 'id' => '',
6192 ),
6193 'acfe_permissions' => '',
6194 'default_value' => '',
6195 'placeholder' => '',
6196 'maxlength' => '',
6197 'rows' => 2,
6198 ),
6199 array(
6200 'key' => 'field_acfe_form_custom_html',
6201 'label' => 'HTML Form render',
6202 'name' => 'acfe_form_custom_html',
6203 'type' => 'acfe_code_editor',
6204 'instructions' => 'Render your own customized HTML.<br /><br />
6205 Field groups may be included using <code>{field_group:group_key}</code><br/><code>{field_group:Group title}</code><br/><br/>
6206 Fields may be included using <code>{field:field_key}</code><br/><code>{field:field_name}</code>',
6207 'required' => 0,
6208 'wrapper' => array(
6209 'width' => '',
6210 'class' => '',
6211 'id' => '',
6212 ),
6213 'acfe_permissions' => '',
6214 'default_value' => '',
6215 'placeholder' => '',
6216 'maxlength' => '',
6217 'rows' => 12,
6218 'conditional_logic' => array(
6219 array(
6220 array(
6221 'field' => 'field_acfe_form_custom_html_enable',
6222 'operator' => '==',
6223 'value' => '1',
6224 ),
6225 ),
6226 ),
6227 ),
6228 array(
6229 'key' => 'field_acfe_form_html_after_fields',
6230 'label' => 'HTML After render',
6231 'name' => 'acfe_form_html_after_fields',
6232 'type' => 'acfe_code_editor',
6233 'instructions' => 'Extra HTML to add after the fields',
6234 'required' => 0,
6235 'conditional_logic' => 0,
6236 'wrapper' => array(
6237 'width' => '',
6238 'class' => '',
6239 'id' => '',
6240 ),
6241 'acfe_permissions' => '',
6242 'default_value' => '',
6243 'placeholder' => '',
6244 'maxlength' => '',
6245 'rows' => 2,
6246 ),
6247
6248 /*
6249 * Validation
6250 */
6251 array(
6252 'key' => 'field_acfe_form_tab_validation',
6253 'label' => 'Validation',
6254 'name' => '',
6255 'type' => 'tab',
6256 'instructions' => '',
6257 'required' => 0,
6258 'conditional_logic' => 0,
6259 'wrapper' => array(
6260 'width' => '',
6261 'class' => '',
6262 'id' => '',
6263 ),
6264 'acfe_permissions' => '',
6265 'placement' => 'top',
6266 'endpoint' => 0,
6267 ),
6268 array(
6269 'key' => 'field_acfe_form_hide_error',
6270 'label' => 'Hide general error',
6271 'name' => 'acfe_form_hide_error',
6272 'type' => 'true_false',
6273 'instructions' => 'Hide the general error message: "Validation failed. 1 field requires attention"',
6274 'required' => 0,
6275 'conditional_logic' => 0,
6276 'wrapper' => array(
6277 'width' => '',
6278 'class' => '',
6279 'id' => '',
6280 ),
6281 'acfe_permissions' => '',
6282 'message' => '',
6283 'default_value' => 0,
6284 'ui' => 1,
6285 'ui_on_text' => '',
6286 'ui_off_text' => '',
6287 ),
6288 array(
6289 'key' => 'field_acfe_form_hide_revalidation',
6290 'label' => 'Hide successful re-validation',
6291 'name' => 'acfe_form_hide_revalidation',
6292 'type' => 'true_false',
6293 'instructions' => 'Hide the successful notice when an error has been thrown',
6294 'required' => 0,
6295 'conditional_logic' => 0,
6296 'wrapper' => array(
6297 'width' => '',
6298 'class' => '',
6299 'id' => '',
6300 ),
6301 'acfe_permissions' => '',
6302 'message' => '',
6303 'default_value' => 0,
6304 'ui' => 1,
6305 'ui_on_text' => '',
6306 'ui_off_text' => '',
6307 ),
6308 array(
6309 'key' => 'field_acfe_form_hide_unload',
6310 'label' => 'Hide confirmation on exit',
6311 'name' => 'acfe_form_hide_unload',
6312 'type' => 'true_false',
6313 'instructions' => 'Do not prompt user on page refresh',
6314 'required' => 0,
6315 'conditional_logic' => 0,
6316 'wrapper' => array(
6317 'width' => '',
6318 'class' => '',
6319 'id' => '',
6320 ),
6321 'acfe_permissions' => '',
6322 'message' => '',
6323 'default_value' => 0,
6324 'ui' => 1,
6325 'ui_on_text' => '',
6326 'ui_off_text' => '',
6327 ),
6328 array(
6329 'key' => 'field_acfe_form_errors_position',
6330 'label' => 'Fields errors position',
6331 'name' => 'acfe_form_errors_position',
6332 'type' => 'radio',
6333 'instructions' => 'Choose where to display field errors',
6334 'required' => 0,
6335 'conditional_logic' => 0,
6336 'wrapper' => array(
6337 'width' => '',
6338 'class' => '',
6339 'id' => '',
6340 ),
6341 'acfe_permissions' => '',
6342 'choices' => array(
6343 'above' => 'Above fields',
6344 'below' => 'Below fields',
6345 'group' => 'Group errors',
6346 'hide' => 'Hide errors',
6347 ),
6348 'allow_null' => 0,
6349 'other_choice' => 0,
6350 'default_value' => 'above',
6351 'layout' => 'vertical',
6352 'return_format' => 'value',
6353 'save_other_choice' => 0,
6354 ),
6355 array(
6356 'key' => 'field_acfe_form_errors_class',
6357 'label' => 'Fields errors class',
6358 'name' => 'acfe_form_errors_class',
6359 'type' => 'text',
6360 'instructions' => 'Add class to error message',
6361 'required' => 0,
6362 'conditional_logic' => array(
6363 array(
6364 array(
6365 'field' => 'field_acfe_form_errors_position',
6366 'operator' => '!=',
6367 'value' => 'group',
6368 ),
6369 array(
6370 'field' => 'field_acfe_form_errors_position',
6371 'operator' => '!=',
6372 'value' => 'hide',
6373 ),
6374 )
6375 ),
6376 'wrapper' => array(
6377 'width' => '',
6378 'class' => '',
6379 'id' => '',
6380 ),
6381 'acfe_permissions' => '',
6382 'default_value' => '',
6383 'placeholder' => '',
6384 'prepend' => '',
6385 'append' => '',
6386 'maxlength' => '',
6387 ),
6388
6389 /*
6390 * Submission
6391 */
6392 array(
6393 'key' => 'field_acfe_form_tab_submission',
6394 'label' => 'Success Page',
6395 'name' => '',
6396 'type' => 'tab',
6397 'instructions' => '',
6398 'required' => 0,
6399 'conditional_logic' => 0,
6400 'wrapper' => array(
6401 'width' => '',
6402 'class' => '',
6403 'id' => '',
6404 ),
6405 'acfe_permissions' => '',
6406 'placement' => 'top',
6407 'endpoint' => 0,
6408 ),
6409 array(
6410 'key' => 'field_acfe_form_return',
6411 'label' => 'Redirection',
6412 'name' => 'acfe_form_return',
6413 'type' => 'text',
6414 'instructions' => 'The URL to be redirected to after the form is submitted. See "Cheatsheet" tab for all available template tags.<br/><br/><u>This setting is deprecated, use the new "Redirect Action" instead.</u>',
6415 'required' => 0,
6416 'conditional_logic' => 0,
6417 'wrapper' => array(
6418 'width' => '',
6419 'class' => '',
6420 'id' => '',
6421 'data-enable-switch' => true
6422 ),
6423 'acfe_permissions' => '',
6424 'default_value' => '',
6425 'placeholder' => '',
6426 'prepend' => '',
6427 'append' => '',
6428 'maxlength' => '',
6429 ),
6430 array(
6431 'key' => 'field_acfe_form_updated_hide_form',
6432 'label' => 'Hide form',
6433 'name' => 'acfe_form_updated_hide_form',
6434 'type' => 'true_false',
6435 'instructions' => 'Hide form on successful submission',
6436 'conditional_logic' => array(
6437 array(
6438 array(
6439 'field' => 'field_acfe_form_return',
6440 'operator' => '==',
6441 'value' => '',
6442 ),
6443 ),
6444 ),
6445 'wrapper' => array(
6446 'width' => '',
6447 'class' => '',
6448 'id' => '',
6449 ),
6450 'acfe_permissions' => '',
6451 'message' => '',
6452 'default_value' => 0,
6453 'ui' => 1,
6454 'ui_on_text' => '',
6455 'ui_off_text' => '',
6456 ),
6457 array(
6458 'key' => 'field_acfe_form_updated_message',
6459 'label' => 'Success message',
6460 'name' => 'acfe_form_updated_message',
6461 'type' => 'wysiwyg',
6462 'instructions' => 'A message displayed above the form after being redirected. See "Cheatsheet" tab for all available template tags.',
6463 'required' => 0,
6464 'conditional_logic' => array(
6465 array(
6466 array(
6467 'field' => 'field_acfe_form_return',
6468 'operator' => '==',
6469 'value' => '',
6470 ),
6471 ),
6472 ),
6473 'wrapper' => array(
6474 'width' => '',
6475 'class' => '',
6476 'id' => '',
6477 'data-instruction-placement' => 'field'
6478 ),
6479 'acfe_permissions' => '',
6480 'default_value' => __('Post updated', 'acf'),
6481 'tabs' => 'all',
6482 'toolbar' => 'full',
6483 'media_upload' => 1,
6484 'delay' => 0,
6485 ),
6486 array(
6487 'key' => 'field_acfe_form_html_updated_message',
6488 'label' => 'Success wrapper HTML',
6489 'name' => 'acfe_form_html_updated_message',
6490 'type' => 'acfe_code_editor',
6491 'instructions' => 'HTML used to render the updated message.<br />
6492 If used, you have to include the following code <code>%s</code> to print the actual "Success message" above.',
6493 'required' => 0,
6494 'conditional_logic' => array(
6495 array(
6496 array(
6497 'field' => 'field_acfe_form_return',
6498 'operator' => '==',
6499 'value' => '',
6500 ),
6501 ),
6502 ),
6503 'wrapper' => array(
6504 'width' => '',
6505 'class' => '',
6506 'id' => '',
6507 'data-instruction-placement' => 'field'
6508 ),
6509 'acfe_permissions' => '',
6510 'default_value' => '<div id="message" class="updated">%s</div>',
6511 'placeholder' => '',
6512 'maxlength' => '',
6513 'rows' => 2,
6514 ),
6515
6516 /*
6517 * Cheatsheet
6518 */
6519 array(
6520 'key' => 'field_acfe_form_tab_cheatsheet',
6521 'label' => 'Cheatsheet',
6522 'name' => '',
6523 'type' => 'tab',
6524 'instructions' => '',
6525 'required' => 0,
6526 'conditional_logic' => 0,
6527 'wrapper' => array(
6528 'width' => '',
6529 'class' => '',
6530 'id' => '',
6531 ),
6532 'acfe_permissions' => '',
6533 'placement' => 'top',
6534 'endpoint' => 0,
6535 ),
6536
6537 array(
6538 'key' => 'field_acfe_form_cheatsheet_field',
6539 'label' => 'Field',
6540 'name' => 'acfe_form_cheatsheet_field',
6541 'type' => 'acfe_dynamic_render',
6542 'instructions' => 'Retrieve user input from the current form',
6543 'required' => 0,
6544 'conditional_logic' => 0,
6545 'wrapper' => array(
6546 'width' => '',
6547 'class' => '',
6548 'id' => '',
6549 ),
6550 ),
6551 array(
6552 'key' => 'field_acfe_form_cheatsheet_fields',
6553 'label' => 'Fields',
6554 'name' => 'acfe_form_cheatsheet_fields',
6555 'type' => 'acfe_dynamic_render',
6556 'instructions' => 'Retrieve all user inputs from the current form',
6557 'required' => 0,
6558 'conditional_logic' => 0,
6559 'wrapper' => array(
6560 'width' => '',
6561 'class' => '',
6562 'id' => '',
6563 ),
6564 ),
6565 array(
6566 'key' => 'field_acfe_form_cheatsheet_get_field',
6567 'label' => 'Get Field',
6568 'name' => 'acfe_form_cheatsheet_get_field',
6569 'type' => 'acfe_dynamic_render',
6570 'instructions' => 'Retrieve ACF field value from database',
6571 'required' => 0,
6572 'conditional_logic' => 0,
6573 'wrapper' => array(
6574 'width' => '',
6575 'class' => '',
6576 'id' => '',
6577 ),
6578 ),
6579 array(
6580 'key' => 'field_acfe_form_cheatsheet_get_option',
6581 'label' => 'Get Option',
6582 'name' => 'acfe_form_cheatsheet_get_option',
6583 'type' => 'acfe_dynamic_render',
6584 'value' => '',
6585 'instructions' => 'Retrieve option value from database',
6586 'required' => 0,
6587 'conditional_logic' => 0,
6588 'wrapper' => array(
6589 'width' => '',
6590 'class' => '',
6591 'id' => '',
6592 ),
6593 ),
6594 array(
6595 'key' => 'field_acfe_form_cheatsheet_request',
6596 'label' => 'Request',
6597 'name' => 'acfe_form_cheatsheet_request',
6598 'type' => 'acfe_dynamic_render',
6599 'value' => '',
6600 'instructions' => 'Retrieve <code>$_REQUEST</code> value',
6601 'required' => 0,
6602 'conditional_logic' => 0,
6603 'wrapper' => array(
6604 'width' => '',
6605 'class' => '',
6606 'id' => '',
6607 ),
6608 ),
6609 array(
6610 'key' => 'field_acfe_form_cheatsheet_query_var',
6611 'label' => 'Query Var',
6612 'name' => 'acfe_form_cheatsheet_query_var',
6613 'type' => 'acfe_dynamic_render',
6614 'instructions' => 'Retrieve query var values. Can be used to get data from previous action',
6615 'required' => 0,
6616 'conditional_logic' => 0,
6617 'wrapper' => array(
6618 'width' => '',
6619 'class' => '',
6620 'id' => '',
6621 ),
6622 ),
6623 array(
6624 'key' => 'field_acfe_form_cheatsheet_current_form',
6625 'label' => 'Form Settings',
6626 'name' => 'acfe_form_cheatsheet_current_form',
6627 'type' => 'acfe_dynamic_render',
6628 'instructions' => 'Retrieve current Dynamic Form data',
6629 'required' => 0,
6630 'conditional_logic' => 0,
6631 'wrapper' => array(
6632 'width' => '',
6633 'class' => '',
6634 'id' => '',
6635 ),
6636 ),
6637 array(
6638 'key' => 'field_acfe_form_cheatsheet_actions_post',
6639 'label' => 'Action Output: Post',
6640 'name' => 'acfe_form_cheatsheet_actions_post',
6641 'type' => 'acfe_dynamic_render',
6642 'instructions' => 'Retrieve actions output',
6643 'required' => 0,
6644 'conditional_logic' => 0,
6645 'wrapper' => array(
6646 'width' => '',
6647 'class' => '',
6648 'id' => '',
6649 ),
6650 ),
6651 array(
6652 'key' => 'acfe_form_cheatsheet_actions_term',
6653 'label' => 'Action Output: Term',
6654 'name' => 'acfe_form_cheatsheet_actions_term',
6655 'type' => 'acfe_dynamic_render',
6656 'instructions' => 'Retrieve actions output',
6657 'required' => 0,
6658 'conditional_logic' => 0,
6659 'wrapper' => array(
6660 'width' => '',
6661 'class' => '',
6662 'id' => '',
6663 ),
6664 ),
6665 array(
6666 'key' => 'acfe_form_cheatsheet_actions_user',
6667 'label' => 'Action Output: User',
6668 'name' => 'acfe_form_cheatsheet_actions_user',
6669 'type' => 'acfe_dynamic_render',
6670 'instructions' => 'Retrieve actions output',
6671 'required' => 0,
6672 'conditional_logic' => 0,
6673 'wrapper' => array(
6674 'width' => '',
6675 'class' => '',
6676 'id' => '',
6677 ),
6678 ),
6679 array(
6680 'key' => 'acfe_form_cheatsheet_actions_email',
6681 'label' => 'Action Output: Email',
6682 'name' => 'acfe_form_cheatsheet_actions_email',
6683 'type' => 'acfe_dynamic_render',
6684 'instructions' => 'Retrieve actions output',
6685 'required' => 0,
6686 'conditional_logic' => 0,
6687 'wrapper' => array(
6688 'width' => '',
6689 'class' => '',
6690 'id' => '',
6691 ),
6692 ),
6693 array(
6694 'key' => 'field_acfe_form_cheatsheet_current_post',
6695 'label' => 'Current Post',
6696 'name' => 'acfe_form_cheatsheet_current_post',
6697 'type' => 'acfe_dynamic_render',
6698 'instructions' => 'Retrieve current post data (where the form is being printed)',
6699 'required' => 0,
6700 'conditional_logic' => 0,
6701 'wrapper' => array(
6702 'width' => '',
6703 'class' => '',
6704 'id' => '',
6705 ),
6706 ),
6707 array(
6708 'key' => 'field_acfe_form_cheatsheet_current_term',
6709 'label' => 'Current Term',
6710 'name' => 'acfe_form_cheatsheet_current_term',
6711 'type' => 'acfe_dynamic_render',
6712 'instructions' => 'Retrieve current term data (where the form is being printed)',
6713 'required' => 0,
6714 'conditional_logic' => 0,
6715 'wrapper' => array(
6716 'width' => '',
6717 'class' => '',
6718 'id' => '',
6719 ),
6720 ),
6721 array(
6722 'key' => 'field_acfe_form_cheatsheet_current_user',
6723 'label' => 'Current User',
6724 'name' => 'acfe_form_cheatsheet_current_user',
6725 'type' => 'acfe_dynamic_render',
6726 'instructions' => 'Retrieve currently logged user data',
6727 'required' => 0,
6728 'conditional_logic' => 0,
6729 'wrapper' => array(
6730 'width' => '',
6731 'class' => '',
6732 'id' => '',
6733 ),
6734 ),
6735 array(
6736 'key' => 'field_acfe_form_cheatsheet_current_author',
6737 'label' => 'Current Author',
6738 'name' => 'acfe_form_cheatsheet_current_author',
6739 'type' => 'acfe_dynamic_render',
6740 'instructions' => 'Retrieve current post author data (where the form is being printed)',
6741 'required' => 0,
6742 'conditional_logic' => 0,
6743 'wrapper' => array(
6744 'width' => '',
6745 'class' => '',
6746 'id' => '',
6747 ),
6748 ),
6749 ),
6750 'location' => array(
6751 array(
6752 array(
6753 'param' => 'post_type',
6754 'operator' => '==',
6755 'value' => 'acfe-form',
6756 ),
6757 ),
6758 ),
6759 'menu_order' => 0,
6760 'position' => 'acf_after_title',
6761 'style' => 'default',
6762 'label_placement' => 'left',
6763 'instruction_placement' => 'label',
6764 'hide_on_screen' => '',
6765 'active' => true,
6766 'description' => '',
6767 'acfe_permissions' => '',
6768 'acfe_form' => 0,
6769 'acfe_meta' => '',
6770 'acfe_note' => '',
6771 ));
6772
6773 }
6774
6775 }
6776
6777 acf_new_instance('acfe_module_form_upgrades');
6778
6779 endif;