WordPress.org

Make WordPress Core

Changeset 27735


Ignore:
Timestamp:
03/26/2014 12:44:42 PM (5 years ago)
Author:
wonderboymusic
Message:

Pass the default mime-type icon as the image for a track when a featured image is not selected for an item in a playlist. Image display in general can be toggled on/off in the modal via Playlist Settings.

Fixes #27525.

File:
1 edited

Legend:

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

    r27733 r27735  
    11951195    }
    11961196
    1197     $supports_thumbs = ( current_theme_supports( 'post-thumbnails', "attachment:$type" ) && post_type_supports( "attachment:$type", 'thumbnail' ) )
    1198         || $images;
    1199 
    12001197    $outer = 22; // default padding and border of wrapper
    12011198
     
    12561253        }
    12571254
    1258         if ( $supports_thumbs ) {
     1255        if ( $images ) {
    12591256            $id = get_post_thumbnail_id( $attachment->ID );
    12601257            if ( ! empty( $id ) ) {
     
    12621259                $track['image'] = compact( 'src', 'width', 'height' );
    12631260                list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' );
     1261                $track['thumb'] = compact( 'src', 'width', 'height' );
     1262            } else {
     1263                $src = wp_mime_type_icon( $attachment->ID );
     1264                $width = 48;
     1265                $height = 64;
     1266                $track['image'] = compact( 'src', 'width', 'height' );
    12641267                $track['thumb'] = compact( 'src', 'width', 'height' );
    12651268            }
Note: See TracChangeset for help on using the changeset viewer.