Make WordPress Core


Ignore:
Timestamp:
03/10/2008 09:31:33 PM (18 years ago)
Author:
matt
Message:

Icon fixes. See #5911; hat tip: andy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r7172 r7212  
    5151function image_downsize($id, $size = 'medium') {
    5252
     53        if ( !wp_attachment_is_image($id) )
     54                return false;
     55
    5356        $img_url = wp_get_attachment_url($id);
    5457        $meta = wp_get_attachment_metadata($id);
     
    7275                        $height = $info[1];
    7376                }
    74                 else
    75                         return false;
    7677        }
    7778        elseif ( isset($meta['width'], $meta['height']) ) {
     
    262263       
    263264        // get a thumbnail or intermediate image if there is one
    264         $image = image_downsize($attachment_id, $size);
    265         if ( $image ) {
    266                 list ( $src, $width, $height ) = $image;
    267         }
    268         elseif ( $src = wp_mime_type_icon($attachment_id) ) {
    269                 $icon_dir = apply_filters( 'icon_dir', get_template_directory() . '/images' );
     265        if ( $image = image_downsize($attachment_id, $size) )
     266                return $image;
     267
     268        if ( $src = wp_mime_type_icon($attachment_id) ) {
     269                $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
    270270                $src_file = $icon_dir . '/' . basename($src);
    271271                @list($width, $height) = getimagesize($src_file);
    272272        }
    273        
    274273        if ( $src && $width && $height )
    275274                return array( $src, $width, $height );
Note: See TracChangeset for help on using the changeset viewer.