From 9f870348793e1387c6b4ee34cf69c158ea754b6e Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 18 Feb 2020 18:17:53 +0000 Subject: [PATCH] Widgets: Revert [47307]. Even though the source URL for an attachment is stored in a variable, attachments should still be passed through the `wp_video_shortcode()` function. Unprops desrosj, spacedmonkey. See #46718. git-svn-id: https://develop.svn.wordpress.org/trunk@47308 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/widgets/class-wp-widget-media-video.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/widgets/class-wp-widget-media-video.php b/src/wp-includes/widgets/class-wp-widget-media-video.php index cd22bca5b2..993af35a65 100644 --- a/src/wp-includes/widgets/class-wp-widget-media-video.php +++ b/src/wp-includes/widgets/class-wp-widget-media-video.php @@ -129,7 +129,7 @@ class WP_Widget_Media_Video extends WP_Widget_Media { $youtube_pattern = '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#'; $vimeo_pattern = '#^https?://(.+\.)?vimeo\.com/.*#'; - if ( preg_match( $youtube_pattern, $src ) || preg_match( $vimeo_pattern, $src ) ) { + if ( $attachment || preg_match( $youtube_pattern, $src ) || preg_match( $vimeo_pattern, $src ) ) { add_filter( 'wp_video_shortcode', array( $this, 'inject_video_max_width_style' ) ); echo wp_video_shortcode(