Media: Avoid a PHP notice in `image_downsize()` when trying to replace a non-image URL with a rendered image from its meta.
Props Mte90, jrf, hareesh-pillai. Fixes #48324. Built from https://develop.svn.wordpress.org/trunk@46772 git-svn-id: http://core.svn.wordpress.org/trunk@46572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2a85fe21d8
commit
012ddf095a
|
@ -220,7 +220,7 @@ function image_downsize( $id, $size = 'medium' ) {
|
||||||
// If the file isn't an image, attempt to replace its URL with a rendered image from its meta.
|
// If the file isn't an image, attempt to replace its URL with a rendered image from its meta.
|
||||||
// Otherwise, a non-image type could be returned.
|
// Otherwise, a non-image type could be returned.
|
||||||
if ( ! $is_image ) {
|
if ( ! $is_image ) {
|
||||||
if ( ! empty( $meta['sizes'] ) ) {
|
if ( ! empty( $meta['sizes']['full'] ) ) {
|
||||||
$img_url = str_replace( $img_url_basename, $meta['sizes']['full']['file'], $img_url );
|
$img_url = str_replace( $img_url_basename, $meta['sizes']['full']['file'], $img_url );
|
||||||
$img_url_basename = $meta['sizes']['full']['file'];
|
$img_url_basename = $meta['sizes']['full']['file'];
|
||||||
$width = $meta['sizes']['full']['width'];
|
$width = $meta['sizes']['full']['width'];
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.4-alpha-46770';
|
$wp_version = '5.4-alpha-46772';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue