From f48e74e789db98b36450142cf325804576dfc37c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 7 Apr 2014 06:19:51 +0000 Subject: [PATCH] Only set the `poster` attribute automatically for videos when the image does not match the default mime-type icon. `wp_prepare_attachment_for_js()` is used in multiple contexts. This context requires disambiguation. See [27659]. git-svn-id: https://develop.svn.wordpress.org/trunk@27980 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/js/media-editor.js b/src/wp-includes/js/media-editor.js index 884b1bd92f..0bb9528051 100644 --- a/src/wp-includes/js/media-editor.js +++ b/src/wp-includes/js/media-editor.js @@ -189,7 +189,7 @@ shortcode = {}; if ( 'video' === type ) { - if ( attachment.image ) { + if ( attachment.image && -1 === attachment.image.src.indexOf( attachment.icon ) ) { shortcode.poster = attachment.image.src; }