From 4a58d1a91bfe5bdfafe1aaceb3890ab257fe8313 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 26 Mar 2014 12:44:42 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@27735 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 2ea61e172a..4b19d2e280 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -1194,9 +1194,6 @@ function wp_get_playlist( $attr, $type ) { return $output; } - $supports_thumbs = ( current_theme_supports( 'post-thumbnails', "attachment:$type" ) && post_type_supports( "attachment:$type", 'thumbnail' ) ) - || $images; - $outer = 22; // default padding and border of wrapper $default_width = 640; @@ -1255,13 +1252,19 @@ function wp_get_playlist( $attr, $type ) { } } - if ( $supports_thumbs ) { + if ( $images ) { $id = get_post_thumbnail_id( $attachment->ID ); if ( ! empty( $id ) ) { list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'full' ); $track['image'] = compact( 'src', 'width', 'height' ); list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' ); $track['thumb'] = compact( 'src', 'width', 'height' ); + } else { + $src = wp_mime_type_icon( $attachment->ID ); + $width = 48; + $height = 64; + $track['image'] = compact( 'src', 'width', 'height' ); + $track['thumb'] = compact( 'src', 'width', 'height' ); } }