'field_clone', 'label' => __("New Field",'acf'), 'name' => __("new_field",'acf'), 'type' => 'text', )); // get name of all fields for use in field type drop down $fields_names = apply_filters('acf/registered_fields', array()); unset( $fields_names[ __("Layout",'acf') ]['tab'] ); // conditional logic dummy data $conditional_logic_rule = array( 'field' => '', 'operator' => '==', 'value' => '' ); ?>
'text', 'name' => 'fields[' . $fake_name . '][label]', 'value' => $sub_field['label'], 'class' => 'label', )); ?> | |||||
'text', 'name' => 'fields[' . $fake_name . '][name]', 'value' => $sub_field['name'], 'class' => 'name', )); ?> | |||||
'select', 'name' => 'fields[' . $fake_name . '][type]', 'value' => $sub_field['type'], 'class' => 'type', 'choices' => $fields_names, 'optgroup' => true )); ?> | |||||
'text', 'name' => 'fields[' . $fake_name . '][instructions]', 'value' => $sub_field['instructions'], 'class' => 'instructions', )); ?> | |||||
'radio', 'name' => 'fields[' .$fake_name . '][required]', 'value' => $sub_field['required'], 'choices' => array( 1 => __("Yes",'acf'), 0 => __("No",'acf'), ), 'layout' => 'horizontal', )); ?> | |||||
'number', 'name' => 'fields[' . $fake_name . '][column_width]', 'value' => $sub_field['column_width'], 'class' => 'column_width', 'append' => '%' )); ?> | |||||
'radio',
'name' => 'fields[' . $fake_name . '][conditional_logic][status]',
'value' => $sub_field['conditional_logic']['status'],
'choices' => array(
1 => __("Yes",'acf'),
0 => __("No",'acf'),
),
'layout' => 'horizontal',
));
// no rules?
if( ! $sub_field['conditional_logic']['rules'] )
{
$sub_field['conditional_logic']['rules'] = array(
array() // this will get merged with $conditional_logic_rule
);
}
?>
>
|
|||||