Make WordPress Core

Changeset 47748


Ignore:
Timestamp:
05/02/2020 10:55:17 PM (4 years ago)
Author:
johnbillion
Message:

Media: Ensure a consistent structure for the array returned by wp_get_attachment_image_src().

The array returned by this function previously included a fourth element only when an intermediate image size was used. This change ensures a consistent structure in the returned array regardless of the function's internal behaviour.

Props wido, joemcgill, johnbillion

Fixes #46113

File:
1 edited

Legend:

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

    r47554 r47748  
    948948 *     @type int    $1 Image width in pixels.
    949949 *     @type int    $2 Image height in pixels.
     950 *     @type bool   $3 Whether the image is a resized image.
    950951 * }
    951952 */
     
    969970
    970971        if ( $src && $width && $height ) {
    971             $image = array( $src, $width, $height );
     972            $image = array( $src, $width, $height, false );
    972973        }
    973974    }
     
    983984     *     @type int    $1 Image width in pixels.
    984985     *     @type int    $2 Image height in pixels.
     986     *     @type bool   $3 Whether the image is a resized image.
    985987     * }
    986988     * @param int          $attachment_id Image attachment ID.
Note: See TracChangeset for help on using the changeset viewer.