Embeds: Change attachment metadata condition to prevent a warning in the embeds template.
Fixes #35237. git-svn-id: https://develop.svn.wordpress.org/trunk@36123 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a03aa810c5
commit
bb07293f8c
@ -50,7 +50,7 @@ if ( have_posts() ) :
|
||||
$image_size = 'full'; // Fallback.
|
||||
|
||||
$meta = wp_get_attachment_metadata( $thumbnail_id );
|
||||
if ( is_array( $meta ) ) {
|
||||
if ( ! empty( $meta['sizes'] ) ) {
|
||||
foreach ( $meta['sizes'] as $size => $data ) {
|
||||
if ( $data['width'] / $data['height'] > $aspect_ratio ) {
|
||||
$aspect_ratio = $data['width'] / $data['height'];
|
||||
|
Loading…
Reference in New Issue
Block a user