From d534c8c3eb209ce0fb5a41c392b1f0bb81bb6f7a Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 23 Mar 2014 03:35:50 +0000 Subject: [PATCH] When inserting a video shortcode into the editor, set the `poster` attribute automatically if the video has a featured image attached to it. See #27460. git-svn-id: https://develop.svn.wordpress.org/trunk@27659 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-editor.js | 4 ++++ src/wp-includes/js/tinymce/skins/wordpress/wp-content.css | 1 + 2 files changed, 5 insertions(+) diff --git a/src/wp-includes/js/media-editor.js b/src/wp-includes/js/media-editor.js index f7253b7969..b65a499b19 100644 --- a/src/wp-includes/js/media-editor.js +++ b/src/wp-includes/js/media-editor.js @@ -189,6 +189,10 @@ shortcode = {}; if ( 'video' === type ) { + if ( attachment.image ) { + shortcode.poster = attachment.image.src; + } + if ( attachment.width ) { shortcode.width = attachment.width; } diff --git a/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css b/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css index fba7b06dac..99b976881c 100644 --- a/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css +++ b/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css @@ -295,6 +295,7 @@ audio { border-color: rgba(0,0,0,0.3); } +.wpview-type-video .track-details, .wpview-type-audio .track-details { position: absolute; top: 0;