Hi HerveSLT.
I update the plugin to 1.1.5. And it allows you to insert [caption] shortcode into the post content area.
If you want display attachment data with a thumbnail, use img_caption_shortcode filter in your functions.php.
Here’s an example code. Customize it to your needs
function add_attachment_data_in_caption( $empty, $attr, $content ) {
$attr = shortcode_atts( array( 'id'=>'', 'align'=>'alignnone', 'width'=>'', 'caption'=>'' ), $attr );
if ( 1 > (int) $attr['width'] || empty( $attr['caption'] ) ) return '';
if ( $attr['id'] ) {
$attr['id'] = 'id="' . esc_attr( $attr['id'] ) . '" ';
$attachment_id = explode('_', $attr['id']);
$attachment_id = $attachment_id[1];// get attachment id
if( get_post_mime_type ( $attachment_id ) === 'application/pdf' ){
$attachment = get_post( $attachment_id );
$bytes = filesize( get_attached_file( $attachment->ID ) );
if ($bytes >= 1073741824) $bytes = number_format($bytes / 1073741824, 2). ' GB';
elseif ($bytes >= 1048576) $bytes = number_format($bytes / 1048576, 2). ' MB';
elseif ($bytes >= 1024) $bytes = number_format($bytes / 1024, 2). ' KB';
elseif ($bytes > 1) $bytes = $bytes. ' bytes';
elseif ($bytes == 1) $bytes = $bytes. ' byte';
else $bytes = '0 bytes';
$attr['caption'] =
'title : ' .$attachment->post_title. '<br/>' . // title
'caption : ' .$attr['caption']. '<br/>' .// caption
'size : ' .$bytes. '<br/>' . // file size
'filetype : ' .get_post_mime_type ( $attachment_id ). '<br/>' . // file type
'description : ' .$attachment->post_content. '<br/>'; // description
}
}
return
'<div ' .$attr['id']. 'class="wp-caption ' .esc_attr( $attr['align'] ). '" style="max-width: ' .( 10 + (int) $attr['width'] ). 'px;">' .
do_shortcode( $content ). '<p class="wp-caption-text">' .$attr['caption']. '</p>' .
'</div>';
}
add_filter('img_caption_shortcode', 'add_attachment_data_in_caption', 10, 3);