WordPress.org

Make WordPress Core

Changeset 35250


Ignore:
Timestamp:
10/17/2015 10:11:28 PM (5 years ago)
Author:
wonderboymusic
Message:

Media: in wp_get_attachment_image_sizes(), ensure that $img_width exists when the image does not.

Props kraftbj.
See #33641.

File:
1 edited

Legend:

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

    r35210 r35250  
    10041004 */
    10051005function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $args = null ) {
    1006 
     1006    $img_width = 0;
    10071007    // Try to get the image width from $args.
    10081008    if ( is_array( $args ) && ! empty( $args['width'] ) ) {
    10091009        $img_width = (int) $args['width'];
    10101010    } elseif ( $img = image_get_intermediate_size( $attachment_id, $size ) ) {
    1011         list( $img_width, $img_height ) = image_constrain_size_for_editor( $img['width'], $img['height'], $size );
     1011        list( $img_width ) = image_constrain_size_for_editor( $img['width'], $img['height'], $size );
    10121012    }
    10131013
Note: See TracChangeset for help on using the changeset viewer.