in web/wp-content/plugins/acf-extended/includes/modules/form/module-form-action-term.php [561:1338]
function register_layout($layout){
return array(
/**
* documentation
*/
array(
'key' => 'field_doc',
'label' => '',
'name' => '',
'type' => 'acfe_dynamic_render',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'render' => function(){
echo '<a href="https://www.acf-extended.com/features/modules/dynamic-forms/term-action" target="_blank">' . __('Documentation', 'acfe') . '</a>';
}
),
/**
* action
*/
array(
'key' => 'field_tab_action',
'label' => __('Action', 'acfe'),
'name' => '',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-no-preference' => true,
),
'placement' => 'top',
'endpoint' => 0,
),
array(
'key' => 'field_type',
'label' => __('Action', 'acfe'),
'name' => 'type',
'type' => 'radio',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'insert_term' => __('Create term', 'acfe'),
'update_term' => __('Update term', 'acfe'),
),
'default_value' => 'insert_term',
),
array(
'key' => 'field_name',
'label' => __('Action name', 'acfe'),
'name' => 'name',
'type' => 'acfe_slug',
'instructions' => __('(Optional) Target this action using hooks.', 'acfe'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-instruction-placement' => 'field'
),
'acfe_permissions' => '',
'default_value' => '',
'placeholder' => __('Term', 'acfe'),
'prepend' => '',
'append' => '',
'maxlength' => '',
),
/**
* save
*/
array(
'key' => 'field_tab_save',
'label' => __('Save', 'acfe'),
'name' => '',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'placement' => 'top',
'endpoint' => 0,
),
array(
'key' => 'field_save_target_group',
'label' => __('Target', 'acfe'),
'name' => 'save_target_group',
'type' => 'group',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'type',
'operator' => '==',
'value' => 'update_term',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'layout' => 'block',
'acfe_seamless_style' => true,
'acfe_group_modal' => 0,
'sub_fields' => array(
array(
'key' => 'field_save_target',
'label' => '',
'name' => 'target',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'{term}' => __('Current Term', 'acfe'),
'{term:parent}' => __('Current Term Parent', 'acfe'),
'custom' => __('Term Selector', 'acfe'),
),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('Default', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax'
),
array(
'key' => 'field_save_target_custom',
'label' => '',
'name' => 'target_custom',
'type' => 'acfe_taxonomy_terms',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_save_target',
'operator' => '==',
'value' => 'custom',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'field_type' => 'select',
'return_format' => 'id',
'ui' => true,
'ajax' => true,
'default_value' => '',
),
),
),
array(
'key' => 'field_save_name',
'label' => __('Name', 'acfe'),
'name' => 'save_name',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'{generated_id}' => __('Generated ID', 'acfe'),
'#{generated_id}' => __('#Generated ID', 'acfe'),
),
'default_value' => array(
),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('Default', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'conditional_logic' => array(),
'ajax_action' => 'acfe/form/map_field_ajax',
),
array(
'key' => 'field_save_slug',
'label' => __('Slug', 'acfe'),
'name' => 'save_slug',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'{generated_id}' => __('Generated ID', 'acfe'),
),
'default_value' => array(
),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('Default', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'conditional_logic' => array(),
'ajax_action' => 'acfe/form/map_field_ajax',
),
array(
'key' => 'field_save_taxonomy',
'label' => __('Taxonomy', 'acfe'),
'name' => 'save_taxonomy',
'type' => 'acfe_taxonomies',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'taxonomy' => '',
'field_type' => 'select',
'default_value' => '',
'return_format' => 'name',
'allow_null' => 1,
'placeholder' => __('Default', 'acfe'),
'multiple' => 0,
'ui' => 1,
'choices' => array(),
'ajax' => 1,
'layout' => '',
'toggle' => 0,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
),
array(
'key' => 'field_save_parent_group',
'label' => __('Parent', 'acfe'),
'name' => 'save_parent_group',
'type' => 'group',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'layout' => 'block',
'acfe_seamless_style' => true,
'acfe_group_modal' => 0,
'sub_fields' => array(
array(
'key' => 'field_save_parent',
'label' => '',
'name' => 'parent',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'{term}' => __('Current Term', 'acfe'),
'{term:parent}' => __('Current Term Parent', 'acfe'),
'custom' => __('Term Selector', 'acfe'),
),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('Default', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax'
),
array(
'key' => 'field_save_parent_custom',
'label' => '',
'name' => 'parent_custom',
'type' => 'acfe_taxonomy_terms',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_save_parent',
'operator' => '==',
'value' => 'custom',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'field_type' => 'select',
'return_format' => 'id',
'ui' => true,
'ajax' => true,
'default_value' => '',
),
),
),
array(
'key' => 'field_save_description_group',
'label' => __('Description', 'acfe'),
'name' => 'save_description_group',
'type' => 'group',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'layout' => 'block',
'acfe_seamless_style' => true,
'acfe_group_modal' => 0,
'sub_fields' => array(
array(
'key' => 'field_save_description',
'label' => '',
'name' => 'description',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'custom' => __('Content Editor', 'acfe'),
),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('Default', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
),
array(
'key' => 'field_save_description_custom',
'label' => '',
'name' => 'description_custom',
'type' => 'wysiwyg',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_save_description',
'operator' => '==',
'value' => 'custom',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'tabs' => 'all',
'toolbar' => 'full',
'media_upload' => 1,
'delay' => 0,
),
),
),
array(
'key' => 'field_save_acf_fields',
'label' => __('Save ACF fields', 'acfe'),
'name' => 'save_acf_fields',
'type' => 'checkbox',
'instructions' => __('Which ACF fields should be saved as metadata', 'acfe'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(),
'allow_custom' => 0,
'default_value' => array(),
'layout' => 'vertical',
'toggle' => 0,
'return_format' => 'value',
'save_custom' => 0,
),
/**
* load
*/
array(
'key' => 'field_tab_load',
'label' => __('Load', 'acfe'),
'name' => '',
'type' => 'tab',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'placement' => 'top',
'endpoint' => 0,
),
array(
'key' => 'field_load_active',
'label' => __('Load Values', 'acfe'),
'name' => 'load_active',
'type' => 'true_false',
'instructions' => __('Fill inputs with values', 'acfe'),
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'message' => '',
'default_value' => 0,
'ui' => 1,
'ui_on_text' => '',
'ui_off_text' => '',
),
array(
'key' => 'field_load_source_group',
'label' => __('Source', 'acfe'),
'name' => 'load_source_group',
'type' => 'group',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'layout' => 'block',
'acfe_seamless_style' => true,
'acfe_group_modal' => 0,
'sub_fields' => array(
array(
'key' => 'field_load_source',
'label' => '',
'name' => 'source',
'type' => 'select',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
'{term}' => __('Current Term', 'acfe'),
'{term:parent}' => __('Current Term Parent', 'acfe'),
'custom' => __('Term Selector', 'acfe'),
),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('Default', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a custom value/template tag.', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax'
),
array(
'key' => 'field_load_source_custom',
'label' => '',
'name' => 'source_custom',
'type' => 'acfe_taxonomy_terms',
'instructions' => '',
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_load_source',
'operator' => '==',
'value' => 'custom',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'field_type' => 'select',
'return_format' => 'id',
'ui' => true,
'ajax' => true,
'default_value' => '',
)
),
),
array(
'key' => 'field_load_name',
'label' => __('Name', 'acfe'),
'name' => 'load_name',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-related-field' => 'field_save_name'
),
'choices' => array(),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('None', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a field key', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
),
array(
'key' => 'field_load_slug',
'label' => __('Slug', 'acfe'),
'name' => 'load_slug',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-related-field' => 'field_save_slug'
),
'choices' => array(),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('None', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a field key', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
),
array(
'key' => 'field_load_taxonomy',
'label' => __('Taxonomy', 'acfe'),
'name' => 'load_taxonomy',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-related-field' => 'field_save_taxonomy'
),
'choices' => array(),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('None', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a field key', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
),
array(
'key' => 'field_load_parent',
'label' => __('Parent', 'acfe'),
'name' => 'load_parent',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-related-field' => 'field_save_parent'
),
'choices' => array(),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('None', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a field key', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
),
array(
'key' => 'field_load_description',
'label' => __('Description', 'acfe'),
'name' => 'load_description',
'type' => 'select',
'instructions' => '',
'required' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
'data-related-field' => 'field_save_description'
),
'choices' => array(),
'default_value' => array(),
'allow_null' => 1,
'multiple' => 0,
'ui' => 1,
'return_format' => 'value',
'placeholder' => __('None', 'acfe'),
'ajax' => 1,
'search_placeholder' => __('Select a field or enter a field key', 'acfe'),
'allow_custom' => 1,
'ajax_action' => 'acfe/form/map_field_ajax',
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
),
array(
'key' => 'field_load_acf_fields',
'label' => __('Load ACF fields', 'acfe'),
'name' => 'load_acf_fields',
'type' => 'checkbox',
'instructions' => __('Select which ACF fields should have their values loaded', 'acfe'),
'required' => 0,
'conditional_logic' => array(
array(
array(
'field' => 'field_load_active',
'operator' => '==',
'value' => '1',
),
),
),
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(),
'allow_custom' => 0,
'default_value' => array(),
'layout' => 'vertical',
'toggle' => 0,
'return_format' => 'value',
'save_custom' => 0,
),
);
}