From e4ed65d87b37d61a07348872f124e8e5214eda62 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 17 May 2016 20:32:09 +0000 Subject: [PATCH] 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 --- src/wp-includes/theme-compat/embed-content.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/theme-compat/embed-content.php b/src/wp-includes/theme-compat/embed-content.php index 05498eb903..fca4f38a62 100644 --- a/src/wp-includes/theme-compat/embed-content.php +++ b/src/wp-includes/theme-compat/embed-content.php @@ -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'];