name = 'flexible_content'; $this->title = __("Flexible Content",'acf'); // filters add_filter('acf_save_field-' . $this->name, array($this, 'acf_save_field')); } /*-------------------------------------------------------------------------------------- * * create_field * - called in lots of places to create the html version of the field * * @author Elliot Condon * @since 2.2.0 * *-------------------------------------------------------------------------------------*/ function create_field($field) { $button_label = ( isset($field['button_label']) && $field['button_label'] != "" ) ? $field['button_label'] : __("+ Add Row",'acf'); $layouts = array(); foreach($field['layouts'] as $l) { $layouts[$l['name']] = $l; } ?>
" href="javascript:;"> |
" href="javascript:;">
" href="javascript:;"> |
" href="javascript:;">
'text', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][label]', 'value' => $layout['label'], )); ?> | 'text', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][name]', 'value' => $layout['name'], )); ?> | 'select', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][display]', 'value' => $layout['display'], 'choices' => array( 'row' => __("Row",'acf'), 'table' => __("Table",'acf'), ) )); ?> |
'text', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][label]', 'value' => $sub_field['label'], 'class' => 'label', )); ?> | |
'text', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][name]', 'value' => $sub_field['name'], 'class' => 'name', )); ?> | |
'select', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][type]', 'value' => $sub_field['type'], 'class' => 'type', 'choices' => $fields_names )); ?> | |
'text', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][instructions]', 'value' => $sub_field['instructions'], 'class' => 'instructions', )); ?> | |
'number', 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][column_width]', 'value' => $sub_field['column_width'], 'class' => 'column_width', )); ?> % | |