WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/01/2016 12:01:38 AM (4 years ago)
Author:
mikeschroder
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r39107 r39396  
    31403140        $response['nonces']['delete'] = wp_create_nonce( 'delete-post_' . $attachment->ID );
    31413141
    3142     if ( $meta && ! empty( $meta['sizes'] ) ) {
     3142    if ( $meta && ( 'image' === $type || ! empty( $meta['sizes'] ) ) ) {
    31433143        $sizes = array();
    31443144
Note: See TracChangeset for help on using the changeset viewer.