From 7c4d77bd04e858b15123d7cc929d8e8f18fda8e4 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 6 Oct 2017 00:38:57 +0000 Subject: [PATCH] Widgets: Apply the same container-constraining embed resizing logic from the Video widget to embeds in the Text widget. See #40854, #39994. git-svn-id: https://develop.svn.wordpress.org/trunk@41779 602fd350-edb4-49c9-b593-d223f7449a82 --- .../widgets/class-wp-widget-text.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/wp-includes/widgets/class-wp-widget-text.php b/src/wp-includes/widgets/class-wp-widget-text.php index 6477ff06b3..c5ebdd41e2 100644 --- a/src/wp-includes/widgets/class-wp-widget-text.php +++ b/src/wp-includes/widgets/class-wp-widget-text.php @@ -290,12 +290,31 @@ class WP_Widget_Text extends WP_Widget { echo $args['before_title'] . $title . $args['after_title']; } + $text = preg_replace_callback( '#<[^>]*>#', array( $this, 'inject_video_max_width_style' ), $text ); + ?>