From 066f37c88587e307957c177b4826cbe75de2491d Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 12 Dec 2009 07:02:26 +0000 Subject: [PATCH] Display "Dimensions" only for image attachments, fixes #11403 git-svn-id: http://svn.automattic.com/wordpress/trunk@12378 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 47792f0bfa..1bfe3e2760 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1193,6 +1193,7 @@ function get_media_item( $attachment_id, $args = null ) { $meta = wp_get_attachment_metadata($post->ID); if ( is_array($meta) && array_key_exists('width', $meta) && array_key_exists('height', $meta) ) $media_dims .= "{$meta['width']} × {$meta['height']} "; + $media_dims = apply_filters('media_meta', $media_dims, $post); $image_edit_button = ''; if ( gd_edit_image_support($post->post_mime_type) ) { @@ -1212,8 +1213,12 @@ function get_media_item( $attachment_id, $args = null ) { " . __('File name:') . " $filename " . __('File type:') . " $post->post_mime_type - " . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ) . " - " . __('Dimensions:') . " " . apply_filters('media_meta', $media_dims, $post) . " + " . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ) . "\n"; + + if ( !empty($media_dims) ) + $item .= "" . __('Dimensions:') . " $media_dims\n"; + + $item .= " $image_edit_button