After [45538]: fix a WPCS fix and make couple of var names consistent.

See #40439.
Built from https://develop.svn.wordpress.org/trunk@45539


git-svn-id: http://core.svn.wordpress.org/trunk@45350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2019-06-15 01:32:53 +00:00
parent 05302bd054
commit 5987caeecc
3 changed files with 9 additions and 5 deletions

View File

@@ -235,7 +235,11 @@ function image_downsize( $id, $size = 'medium' ) {
} elseif ( $size === 'thumbnail' ) {
// fall back to the old thumbnail
$thumb_file = wp_get_attachment_thumb_file( $id );
$info = getimagesize( $thumb_file );
$info = null;
if ( $thumb_file ) {
$info = getimagesize( $thumb_file );
}
if ( $thumb_file && $info ) {
$img_url = str_replace( $img_url_basename, wp_basename( $thumb_file ), $img_url );