Embeds: Change attachment metadata condition to prevent a warning in the embeds template.
See #35237. Fixes #36838 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@37452 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
747a327c3c
commit
e4ed65d87b
|
@ -27,7 +27,7 @@
|
|||
$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