<?php // defaults if (empty($field['button_label'])) { $field['button_label'] = $this->defaults['button_label']; } // sort layouts into names $layouts = array(); foreach ($field['layouts'] as $l) { $layouts[$l['name']] = acf_get_valid_flexible_content_layout($l); } // clean up memory unset($field['layouts']); // vars $i = 'acfcloneindex'; $value = array(); // helper function which does not exist yet in acf if (!function_exists('acf_get_join_attr')) { function acf_get_join_attr($attributes = false) { // validate if (empty($attributes)) { return ''; } // vars $e = array(); // loop through and render foreach ($attributes as $k => $v) { $e[] = $k . '="' . esc_attr($v) . '"'; } // echo
// vars $key = $field['name']; // load default layout if (empty($field['layouts'])) { $field['layouts'][] = acf_get_valid_flexible_content_layout(); } // 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')]['flexible_content'], $fields_names[__("Layout", 'acf')]['tab']); // conditional logic dummy data $conditional_logic_rule = array('field' => '', 'operator' => '==', 'value' => ''); // loop through layouts foreach ($field['layouts'] as $layout_key => $layout) { // get valid layout $layout = acf_get_valid_flexible_content_layout($layout); // add sub field clone to layout $layout['sub_fields'][] = apply_filters('acf/load_field_defaults', array('key' => 'field_clone', 'type' => 'text', 'label' => __("New Field", 'acf'), 'name' => __("new_field", 'acf'))); ?> <tr class="field_option field_option_<?php echo $this->name; ?> " data-id="<?php echo $layout_key; ?> "> <td class="label"> <label><?php _e("Layout", 'acf');