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:
Pascal Birchler 2016-05-17 20:32:09 +00:00
parent 747a327c3c
commit e4ed65d87b
1 changed files with 1 additions and 1 deletions

View File

@ -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'];