'; /* container for the image preview (or file ico) and name and file type */ if( !empty ( $value ) ){ /* it can hold multiple attachments separated by comma */ $values = explode( ',', $value ); foreach( $values as $value ){ $file_src = wp_get_attachment_url($value); $thumbnail = wp_get_attachment_image( $value, array( 80, 80 ), true ); $file_name = get_the_title( $value ); $file_type = get_post_mime_type( $value ); $attachment_url = admin_url( "post.php?post={$value}&action=edit" ); $element.= '
'; $element.= $file_name; $element.= ''; $element.= $file_type; $element.= ''; if( !empty ( $value ) ) $element.= ''.__( 'Remove', 'core' ).''; $element.= '