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. Merges [39396] to the 4.7 branch. Fixes #38965 for 4.7. Props joemcgill, clorith, mikeschroder. Built from https://develop.svn.wordpress.org/branches/4.7@39399 git-svn-id: http://core.svn.wordpress.org/branches/4.7@39339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7b69275632
commit
bc1df6bef1
|
@ -3139,7 +3139,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
|
||||||
if ( current_user_can( 'delete_post', $attachment->ID ) )
|
if ( current_user_can( 'delete_post', $attachment->ID ) )
|
||||||
$response['nonces']['delete'] = wp_create_nonce( '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();
|
$sizes = array();
|
||||||
|
|
||||||
/** This filter is documented in wp-admin/includes/media.php */
|
/** This filter is documented in wp-admin/includes/media.php */
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-RC1-39398';
|
$wp_version = '4.7-RC1-39399';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue