From c3a2635dc8a89b2e65ee7b3438c950072cf4ff29 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 28 Mar 2014 12:50:14 +0000 Subject: [PATCH] Return the default mime icon for playlist items that don't have a featured image in `wp_prepare_attachment_for_js()`. See [27640]. Built from https://develop.svn.wordpress.org/trunk@27813 git-svn-id: http://core.svn.wordpress.org/trunk@27647 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wp-includes/media.php b/wp-includes/media.php index 69079a8023..d9f00267cc 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2325,6 +2325,12 @@ function wp_prepare_attachment_for_js( $attachment ) { $response['image'] = compact( 'src', 'width', 'height' ); list( $src, $width, $height ) = wp_get_attachment_image_src( $id, 'thumbnail' ); $response['thumb'] = compact( 'src', 'width', 'height' ); + } else { + $src = wp_mime_type_icon( $attachment->ID ); + $width = 48; + $height = 64; + $response['image'] = compact( 'src', 'width', 'height' ); + $response['thumb'] = compact( 'src', 'width', 'height' ); } }