Embeds: Change attachment metadata condition to prevent a warning in the embeds template.

Merges [36123] to the 4.4 branch.
Fixes #35237.


git-svn-id: https://develop.svn.wordpress.org/branches/4.4@36147 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2016-01-02 03:35:47 +00:00
parent 462b6016b7
commit 7c08f52a27

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