Display "Dimensions" only for image attachments, fixes #11403
git-svn-id: http://svn.automattic.com/wordpress/trunk@12378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d4d309a1c6
commit
066f37c885
|
@ -1193,6 +1193,7 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||||
$meta = wp_get_attachment_metadata($post->ID);
|
$meta = wp_get_attachment_metadata($post->ID);
|
||||||
if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) )
|
if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) )
|
||||||
$media_dims .= "<span id='media-dims-{$post->ID}'>{$meta['width']} × {$meta['height']}</span> ";
|
$media_dims .= "<span id='media-dims-{$post->ID}'>{$meta['width']} × {$meta['height']}</span> ";
|
||||||
|
$media_dims = apply_filters('media_meta', $media_dims, $post);
|
||||||
|
|
||||||
$image_edit_button = '';
|
$image_edit_button = '';
|
||||||
if ( gd_edit_image_support($post->post_mime_type) ) {
|
if ( gd_edit_image_support($post->post_mime_type) ) {
|
||||||
|
@ -1212,8 +1213,12 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||||
<td><strong>" . __('File name:') . "</strong> $filename</td>
|
<td><strong>" . __('File name:') . "</strong> $filename</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td><strong>" . __('File type:') . "</strong> $post->post_mime_type</td></tr>
|
<tr><td><strong>" . __('File type:') . "</strong> $post->post_mime_type</td></tr>
|
||||||
<tr><td><strong>" . __('Upload date:') . "</strong> " . mysql2date( get_option('date_format'), $post->post_date ) . "</td></tr>
|
<tr><td><strong>" . __('Upload date:') . "</strong> " . mysql2date( get_option('date_format'), $post->post_date ) . "</td></tr>\n";
|
||||||
<tr><td><strong>" . __('Dimensions:') . "</strong> " . apply_filters('media_meta', $media_dims, $post) . "</td></tr>
|
|
||||||
|
if ( !empty($media_dims) )
|
||||||
|
$item .= "<tr><td><strong>" . __('Dimensions:') . "</strong> $media_dims</td></tr>\n";
|
||||||
|
|
||||||
|
$item .= "
|
||||||
<tr><td class='A1B1'>$image_edit_button</td></tr>
|
<tr><td class='A1B1'>$image_edit_button</td></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
Loading…
Reference in New Issue