From bb07293f8cb2621f1747d2f61ca9cb90c24514ec Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 30 Dec 2015 22:24:31 +0000 Subject: [PATCH] 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 --- src/wp-includes/embed-template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/embed-template.php b/src/wp-includes/embed-template.php index df2518f98f..fab8c84221 100644 --- a/src/wp-includes/embed-template.php +++ b/src/wp-includes/embed-template.php @@ -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'];