From f89f744fb208640686a465c91992fd97b2bceef9 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sat, 2 May 2020 22:57:06 +0000 Subject: [PATCH] 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 Built from https://develop.svn.wordpress.org/trunk@47748 git-svn-id: http://core.svn.wordpress.org/trunk@47524 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index d1dfbc24a5..28be1549ac 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -947,6 +947,7 @@ function wp_get_registered_image_subsizes() { * @type string $0 Image source URL. * @type int $1 Image width in pixels. * @type int $2 Image height in pixels. + * @type bool $3 Whether the image is a resized image. * } */ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon = false ) { @@ -968,7 +969,7 @@ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon } if ( $src && $width && $height ) { - $image = array( $src, $width, $height ); + $image = array( $src, $width, $height, false ); } } /** @@ -982,6 +983,7 @@ function wp_get_attachment_image_src( $attachment_id, $size = 'thumbnail', $icon * @type string $0 Image source URL. * @type int $1 Image width in pixels. * @type int $2 Image height in pixels. + * @type bool $3 Whether the image is a resized image. * } * @param int $attachment_id Image attachment ID. * @param string|int[] $size Requested size of image. Image size name, or array of width diff --git a/wp-includes/version.php b/wp-includes/version.php index 435a4cd663..bd26d6feb7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47747'; +$wp_version = '5.5-alpha-47748'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.