Ticket #20205: 20205.3.patch
File 20205.3.patch, 1.3 KB (added by , 12 years ago) |
---|
-
wp-includes/media.php
508 508 function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon = false) { 509 509 510 510 // get a thumbnail or intermediate image if there is one 511 if ( $image = image_downsize($attachment_id, $size) ) 512 return $image; 511 if ( ! $image = image_downsize( $attachment_id, $size ) ) { 513 512 514 $src = false;513 $src = false; 515 514 516 if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { 517 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 518 $src_file = $icon_dir . '/' . wp_basename($src); 519 @list($width, $height) = getimagesize($src_file); 515 if ( $icon && $src = wp_mime_type_icon( $attachment_id ) ) { 516 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 517 $src_file = $icon_dir . '/' . wp_basename( $src ); 518 @list( $width, $height ) = getimagesize( $src_file ); 519 520 if ( $src && $width && $height ) 521 $image = array( $src, $width, $height ); 522 } 520 523 } 521 if ( $src && $width && $height ) 522 return array( $src, $width, $height ); 523 return false; 524 return apply_filters( 'wp_attachment_image_src', $image, $attachment_id, $size, $icon ); 524 525 } 525 526 526 527 /**