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

@ -87,7 +87,7 @@ function wp_get_missing_image_subsizes( $attachment_id ) {
// Meta error?
if ( empty( $image_meta ) ) {
return $defined_sizes;
return $registered_sizes;
}
$full_width = (int) $image_meta['width'];
@ -379,8 +379,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
*/
$fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );
$defined_sizes = wp_get_registered_image_subsizes();
$merged_sizes = array_intersect_key( $defined_sizes, array_flip( $fallback_sizes ) );
$registered_sizes = wp_get_registered_image_subsizes();
$merged_sizes = array_intersect_key( $registered_sizes, array_flip( $fallback_sizes ) );
// Force thumbnails to be soft crops.
if ( isset( $merged_sizes['thumbnail'] ) && is_array( $merged_sizes['thumbnail'] ) ) {

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 );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45538';
$wp_version = '5.3-alpha-45539';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.