Changeset 7212 for trunk/wp-includes/media.php
- Timestamp:
- 03/10/2008 09:31:33 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/media.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)