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); ?>
esc_attr(sanitize_key($acf_mc_key)), 'acf_field_name' => esc_attr(sanitize_text_field($acf_mc_name)), 'post_id' => esc_attr(sanitize_text_field(preg_replace('/\D/', '', $post_id))), 'attachment_id' => esc_attr(sanitize_text_field(preg_replace('/\D/', '', $id))) ); $defaults = array( array( 'label' => 'Alt Text', 'control' => array('table' => 'postmeta', 'type' => 'text', 'name' => '_wp_attachment_image_alt', 'value' => esc_attr(sanitize_text_field($alt_text))) ), array( 'label' => 'Title', 'control' => array('table' => 'posts', 'type' => 'text', 'name' => 'post_title', 'value' => esc_attr(sanitize_text_field($title))) ), array( 'label' => 'Caption', 'control' => array('table' => 'posts', 'rows' => 3, 'type' => 'textarea', 'name' => 'post_excerpt', 'value' => esc_attr(sanitize_text_field($caption))) ), array( 'label' => 'Description', 'control' => array('table' => 'posts', 'rows' => 3, 'type' => 'textarea', 'name' => 'post_content', 'value' => esc_html(sanitize_text_field($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

'; if( !empty($attr['label']) ){ echo ""; } if( !empty($attr['control']) ){ if( $attr['control']['type'] == "text" ){ echo ' $b){ if($a == "table"){ $tables[$attr['control']['name']] = esc_attr($b); } if( ($attr['control']['type'] == "textarea" and $a == "value") or $a == "table" ){ continue; } echo esc_attr($a) . ' = "' . esc_attr($b) . '" '; } echo '/>'; } else if( $attr['control']['type'] == "textarea" ){ echo ''; } } echo '
'; } } ?>