From 3d0c06e1f6aa0f971357cd0153f28511a3fa13b1 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Tue, 17 May 2016 20:38:32 +0000 Subject: [PATCH] Embeds: Change attachment metadata condition to prevent a warning in the embeds template. Merge of [37452] to the 4.5 branch. Props swissspidy. See #35237. Fixes #36838. Built from https://develop.svn.wordpress.org/branches/4.5@37455 git-svn-id: http://core.svn.wordpress.org/branches/4.5@37423 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme-compat/embed-content.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme-compat/embed-content.php b/wp-includes/theme-compat/embed-content.php index 05498eb903..fca4f38a62 100644 --- a/wp-includes/theme-compat/embed-content.php +++ b/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']; diff --git a/wp-includes/version.php b/wp-includes/version.php index 5bb8729e50..ec920eacf1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5.3-alpha-37454'; +$wp_version = '4.5.3-alpha-37455'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.