Skip to content

Commit cc9f966

Browse files
Docs: Correct indentation for a multi-line comment.
Includes reformatting a long conditional for better readability. Follow-up to [38086], [42343]. Props mukesh27, SergeyBiryukov. See #63166. git-svn-id: https://develop.svn.wordpress.org/trunk@60730 602fd350-edb4-49c9-b593-d223f7449a82
1 parent cbb79ca commit cc9f966

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/wp-includes/media.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -824,12 +824,15 @@ function image_get_intermediate_size( $post_id, $size = 'thumbnail' ) {
824824
}
825825

826826
$data = array_shift( $candidates );
827+
} elseif ( ! empty( $imagedata['sizes']['thumbnail'] )
828+
&& $size[0] <= $imagedata['sizes']['thumbnail']['width']
829+
&& $size[1] <= $imagedata['sizes']['thumbnail']['width']
830+
) {
827831
/*
828-
* When the size requested is smaller than the thumbnail dimensions, we
829-
* fall back to the thumbnail size to maintain backward compatibility with
830-
* pre 4.6 versions of WordPress.
831-
*/
832-
} elseif ( ! empty( $imagedata['sizes']['thumbnail'] ) && $imagedata['sizes']['thumbnail']['width'] >= $size[0] && $imagedata['sizes']['thumbnail']['width'] >= $size[1] ) {
832+
* When the size requested is smaller than the thumbnail dimensions, we
833+
* fall back to the thumbnail size to maintain backward compatibility with
834+
* pre-4.6 versions of WordPress.
835+
*/
833836
$data = $imagedata['sizes']['thumbnail'];
834837
} else {
835838
return false;

0 commit comments

Comments
 (0)