Changeset 7212
- Timestamp:
- 03/10/2008 09:31:33 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
wp-admin/edit-attachment-rows.php (modified) (2 diffs)
-
wp-includes/media.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-attachment-rows.php
r7036 r7212 40 40 case 'icon': 41 41 ?> 42 <td class="media-icon"><?php echo the_attachment_link($post->ID, false, array(48,48)); ?></td>42 <td class="media-icon"><?php echo get_the_attachment_link($post->ID, 'thumbnail', array(48,48)); ?></td> 43 43 <?php 44 44 // TODO … … 47 47 case 'media': 48 48 ?> 49 <td><strong>< a href="# TODO: upload.php?action=edit&post=<?php the_ID(); ?>"><?php the_title(); ?></a></strong><br />49 <td><strong><!-- TODO <a href="upload.php?action=edit&post=<?php the_ID(); ?>"> --><?php the_title(); ?><!-- </a> --></strong><br /> 50 50 <?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?> 51 51 <?php do_action('manage_media_media_column', $post->ID); ?> -
trunk/wp-includes/media.php
r7172 r7212 51 51 function image_downsize($id, $size = 'medium') { 52 52 53 if ( !wp_attachment_is_image($id) ) 54 return false; 55 53 56 $img_url = wp_get_attachment_url($id); 54 57 $meta = wp_get_attachment_metadata($id); … … 72 75 $height = $info[1]; 73 76 } 74 else75 return false;76 77 } 77 78 elseif ( isset($meta['width'], $meta['height']) ) { … … 262 263 263 264 // get a thumbnail or intermediate image if there is one 264 $image = image_downsize($attachment_id, $size); 265 if ( $image ) { 266 list ( $src, $width, $height ) = $image; 267 } 268 elseif ( $src = wp_mime_type_icon($attachment_id) ) { 269 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' ); 265 if ( $image = image_downsize($attachment_id, $size) ) 266 return $image; 267 268 if ( $src = wp_mime_type_icon($attachment_id) ) { 269 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 270 270 $src_file = $icon_dir . '/' . basename($src); 271 271 @list($width, $height) = getimagesize($src_file); 272 272 } 273 274 273 if ( $src && $width && $height ) 275 274 return array( $src, $width, $height );
Note: See TracChangeset
for help on using the changeset viewer.