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
This commit is contained in:
Jonathan Desrosiers 2020-02-18 18:17:53 +00:00
parent 0d7a5f949d
commit 9f87034879
1 changed files with 1 additions and 1 deletions

View File

@ -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(