WordPress.org

Make WordPress Core

Changeset 7212


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

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-attachment-rows.php

    r7036 r7212  
    4040    case 'icon':
    4141        ?>
    42         <td class="media-icon"><?php echo the_attachment_link($post->ID, false, array(48,48)); ?></td>
     42        <td class="media-icon"><?php echo get_the_attachment_link($post->ID, 'thumbnail', array(48,48)); ?></td>
    4343        <?php
    4444        // TODO
     
    4747    case 'media':
    4848        ?>
    49         <td><strong><a href="# TODO: upload.php?action=edit&amp;post=<?php the_ID(); ?>"><?php the_title(); ?></a></strong><br />
     49        <td><strong><!-- TODO <a href="upload.php?action=edit&amp;post=<?php the_ID(); ?>"> --><?php the_title(); ?><!-- </a> --></strong><br />
    5050        <?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
    5151        <?php do_action('manage_media_media_column', $post->ID); ?>
  • 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.