Ticket #32363: 32363.3.patch
| File 32363.3.patch, 1.5 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/media.php
688 688 * @return bool|array Returns an array (url, width, height), or false, if no image is available. 689 689 */ 690 690 function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) { 691 691 $image = false; 692 692 // get a thumbnail or intermediate image if there is one 693 if ( $image = image_downsize($attachment_id, $size) ) 694 return $image; 693 $image = image_downsize($attachment_id, $size); 694 if(!$image) { 695 $src = false; 695 696 696 $src = false; 697 if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { 698 /** This filter is documented in wp-includes/post.php */ 699 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 697 700 698 if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { 699 /** This filter is documented in wp-includes/post.php */ 700 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 701 702 $src_file = $icon_dir . '/' . wp_basename($src); 703 @list($width, $height) = getimagesize($src_file); 701 $src_file = $icon_dir . '/' . wp_basename($src); 702 @list($width, $height) = getimagesize($src_file); 703 } 704 if ( $src && $width && $height ) 705 $image = array( $src, $width, $height ); 704 706 } 705 if ( $src && $width && $height ) 706 return array( $src, $width, $height ); 707 return false; 707 return apply_filters('wp_get_attachment_image_src_fallback', $image, $attachment_id, $size, $icon); 708 708 } 709 709 710 710 /**