ID); $alt_text = get_field('_wp_attachment_image_alt', $item->ID); $title = get_the_title($item->ID); $caption = get_the_excerpt($item->ID); $description = get_the_content(null, false, $item->ID); ?>
$acf_mc_key, 'acf_field_name' => $acf_mc_name, 'post_id' => $post_id, 'attachment_id' => $id ); $defaults = array( array( 'label' => 'Alt Text', 'control' => array('table' => 'postmeta', 'type' => 'text', 'name' => '_wp_attachment_image_alt', 'value' => esc_attr($alt_text)) ), array( 'label' => 'Title', 'control' => array('table' => 'posts', 'type' => 'text', 'name' => 'post_title', 'value' => esc_attr($title)) ), array( 'label' => 'Caption', 'control' => array('table' => 'posts', 'rows' => 3, 'type' => 'textarea', 'name' => 'post_excerpt', 'value' => esc_attr($caption)) ), array( 'label' => 'Description', 'control' => array('table' => 'posts', 'rows' => 3, 'type' => 'textarea', 'name' => 'post_content', 'value' => esc_html($description)) ) ); $fields = apply_filters('acf/media-cluster-edit-fields', $post, $defaults); $html = ''; if( !empty($fields) ){ foreach( $fields as $attr ){ $html .= '
'; if( !empty($attr['label']) ){ $html .= ""; } if( !empty($attr['control']) ){ $c = ""; foreach($attr['control'] as $a => $b){ if($a == "table"){ $tables[$attr['control']['name']] = $b; } if( ($attr['control']['type'] == "textarea" and $a == "value") or $a == "table" ){ continue; } $c .= esc_attr($a) . ' = "' . esc_attr($b) . '"'; } if( $attr['control']['type'] == "text" ){ $html .= ''; } else if( $attr['control']['type'] == "textarea" ){ $html .= ''; } } $html .= '
'; } } ?>

Edit