From e94f08380e77a783daf2e0671313da8ea1e773d3 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 28 Mar 2014 12:49:48 +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]. git-svn-id: https://develop.svn.wordpress.org/trunk@27813 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/media.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 69079a8023..d9f00267cc 100644 --- a/src/wp-includes/media.php +++ b/src/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' ); } }