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:
Pascal Birchler 2015-12-30 22:24:31 +00:00
parent a03aa810c5
commit bb07293f8c
1 changed files with 1 additions and 1 deletions

View File

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