| 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 ); |
| 705 | | if ( $src && $width && $height ) |
| 706 | | return array( $src, $width, $height ); |
| 707 | | return false; |
| | 707 | /** |
| | 708 | * Filter the image src result |
| | 709 | * |
| | 710 | * @since 4.3.0 |
| | 711 | * |
| | 712 | * @param mixed $image either array with src, width & height, icon src, or false. |
| | 713 | * @param int $attachment_id Image attachment ID. |
| | 714 | * @param string|array $size Optional. Registered image size to retrieve the source for or a flat |
| | 715 | * array of height and width dimensions. Default 'thumbnail'. |
| | 716 | * @param bool $icon Optional. Whether the image should be treated as an icon. Default false. |
| | 717 | */ |
| | 718 | return apply_filters('attachment_image_src', $image, $attachment_id, $size, $icon); |