From f63c6fd344c56cb88d49cf434dd7433cd58f505c Mon Sep 17 00:00:00 2001 From: Mike Schroder Date: Thu, 1 Dec 2016 00:02:41 +0000 Subject: [PATCH] Media: Fix regression with display of small images in media library. Fixes a regression in the media library after [38949], which caused small images (< thumbnail size) to not display within the media library. Accounts for images that have no intermediate sizes in `wp_prepare_attachment_for_js()`. Adds test. Fixes #38965. Props joemcgill, clorith, mikeschroder. Built from https://develop.svn.wordpress.org/trunk@39396 git-svn-id: http://core.svn.wordpress.org/trunk@39336 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index a3a8088a15..ba52555932 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -3139,7 +3139,7 @@ function wp_prepare_attachment_for_js( $attachment ) { if ( current_user_can( 'delete_post', $attachment->ID ) ) $response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID ); - if ( $meta && ! empty( $meta['sizes'] ) ) { + if ( $meta && ( 'image' === $type || ! empty( $meta['sizes'] ) ) ) { $sizes = array(); /** This filter is documented in wp-admin/includes/media.php */ diff --git a/wp-includes/version.php b/wp-includes/version.php index da75fbc46a..cb2d3fc291 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-39393'; +$wp_version = '4.8-alpha-39396'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.