ID); // add clone $fields[] = apply_filters('acf/load_field_defaults', array( 'key' => 'field_clone', 'label' => __("New Field",'acf'), 'name' => 'new_field', 'type' => 'text', )); // get name of all fields for use in field type drop down $field_types = apply_filters('acf/registered_fields', array()); // helper function function field_type_exists( $name ) { global $field_types; foreach( $field_types as $category ) { if( isset( $category[ $name ] ) ) { return $category[ $name ]; } } return false; } // conditional logic dummy data $conditional_logic_rule = array( 'field' => '', 'operator' => '==', 'value' => '' ); $error_field_type = '' . __('Error', 'acf') . ' ' . __('Field type does not exist', 'acf'); ?>
1){ echo 'style="display:none;"'; } ?>> + Add Field button to create your first field.",'acf'); ?>

'text', 'name' => 'fields[' .$fake_name . '][label]', 'value' => $field['label'], 'class' => 'label', )); ?>

'text', 'name' => 'fields[' .$fake_name . '][name]', 'value' => $field['name'], 'class' => 'name', )); ?>
'select', 'name' => 'fields[' .$fake_name . '][type]', 'value' => $field['type'], 'choices' => $field_types, )); ?>

'textarea', 'name' => 'fields[' .$fake_name . '][instructions]', 'value' => $field['instructions'], 'rows' => 6 )); ?>
'radio', 'name' => 'fields[' .$fake_name . '][required]', 'value' => $field['required'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?>
'radio', 'name' => 'fields['.$field['key'].'][conditional_logic][status]', 'value' => $field['conditional_logic']['status'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); // no rules? if( ! $field['conditional_logic']['rules'] ) { $field['conditional_logic']['rules'] = array( array() // this will get merged with $conditional_logic_rule ); } ?>
> $rule ): // validate $rule = array_merge($conditional_logic_rule, $rule); // fix PHP error in 3.5.4.1 if( strpos($rule['value'],'Undefined index: value in') !== false ) { $rule['value'] = ''; } ?>
'select', 'name' => 'fields['.$field['key'].'][conditional_logic][rules][' . $rule_i . '][operator]', 'value' => $rule['operator'], 'choices' => array( '==' => __("is equal to",'acf'), '!=' => __("is not equal to",'acf'), ), )); ?>
  • 'select', 'name' => 'fields['.$field['key'].'][conditional_logic][allorany]', 'value' => $field['conditional_logic']['allorany'], 'choices' => array( 'all' => __("all",'acf'), 'any' => __("any",'acf'), ), )); ?>