Ticket #24430: 24430.diff
File 24430.diff, 1.1 KB (added by , 10 years ago) |
---|
-
media.php
690 690 function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) { 691 691 692 692 // get a thumbnail or intermediate image if there is one 693 if ( $image = image_downsize($attachment_id, $size) ) 693 if ( $image = image_downsize($attachment_id, $size) ) { 694 694 return $image; 695 } 695 696 696 697 $src = false; 697 698 698 699 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' ); 700 // wp_mime_type_icon sets 'icon_files' cache 701 @list($width, $height) = getimagesize(array_search($src, wp_cache_get('icon_files'))); 702 } 701 703 702 $src_file = $icon_dir . '/' . wp_basename($src);703 @list($width, $height) = getimagesize($src_file);704 if ( $src && $width && $height ) { 705 return array( $src, $width, $height ); 704 706 } 705 if ( $src && $width && $height ) 706 return array( $src, $width, $height ); 707 707 708 return false; 708 709 } 709 710