diff --git a/src/wp-includes/widgets/class-wp-widget-text.php b/src/wp-includes/widgets/class-wp-widget-text.php
index 36b05b3..4ba8061 100644
a
|
b
|
class WP_Widget_Text extends WP_Widget { |
340 | 340 | */ |
341 | 341 | public function inject_video_max_width_style( $matches ) { |
342 | 342 | $html = $matches[0]; |
| 343 | preg_match( '@height="([^"]+)"@' , $html, $match_height ); |
| 344 | preg_match( '@width="([^"]+)"@' , $html, $match_width ); |
| 345 | $height = array_pop( $match_height ); |
| 346 | $width = array_pop( $match_width ); |
| 347 | if ( ! empty ( $height ) ) { |
| 348 | $html = preg_replace( '/\sheight="\d+"/', 'data-placeholder-height="' . $height . '"/', $html ); |
| 349 | } |
| 350 | if ( ! empty ( $width ) ) { |
| 351 | $html = preg_replace( '/\swidth="\d+"/', 'data-placeholder-width="' . $width . '"/', $html ); |
| 352 | } |
343 | 353 | $html = preg_replace( '/\sheight="\d+"/', '', $html ); |
344 | 354 | $html = preg_replace( '/\swidth="\d+"/', '', $html ); |
345 | 355 | $html = preg_replace( '/(?<=width:)\s*\d+px(?=;?)/', '100%', $html ); |
| 356 | $html = str_replace( 'data-placeholder-height', 'height', $html ); |
| 357 | $html = str_replace( 'data-placeholder-width', 'width', $html ); |
346 | 358 | return $html; |
347 | 359 | } |
348 | 360 | |