Ticket #29702: 29702.diff
| File 29702.diff, 1.7 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/media.php
654 654 * @param bool $icon Optional, default is false. Whether it is an icon. 655 655 * @return bool|array Returns an array (url, width, height), or false, if no image is available. 656 656 */ 657 function wp_get_attachment_image_src( $attachment_id, $size='thumbnail', $icon = false) {657 function wp_get_attachment_image_src( $attachment_id, $size='thumbnail', $icon = false ) { 658 658 659 659 // get a thumbnail or intermediate image if there is one 660 if ( $image = image_downsize( $attachment_id, $size) )660 if ( $image = image_downsize( $attachment_id, $size ) ) 661 661 return $image; 662 662 663 663 $src = false; 664 664 665 if ( $icon && $src = wp_mime_type_icon( $attachment_id) ) {665 if ( $icon && $src = wp_mime_type_icon( $attachment_id ) ) { 666 666 /** This filter is documented in wp-includes/post.php */ 667 667 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 668 $src_file = $icon_dir . '/' . wp_basename( $src);669 @list( $width, $height) = getimagesize($src_file);668 $src_file = $icon_dir . '/' . wp_basename( $src ); 669 @list( $width, $height ) = getimagesize( $src_file ); 670 670 } 671 if ( $src && $width && $height ) 672 return array( $src, $width, $height ); 671 if ( $src && $width && $height ) { 672 /** 673 * Filter the list of attachment image attributes. 674 * 675 * @since 4.1.0 676 * 677 * @param array $attr Attributes for the image (src, width, height). 678 */ 679 $attr = array( $src, $width, $height ); 680 return apply_filters( 'wp_get_attachment_image_src', $attr ); 681 } 673 682 return false; 674 683 } 675 684
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)