mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 06:37:06 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@39396 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user