Video: use auto instead of actual height for the responsive wrapper in generated markup.

See #29110.

Built from https://develop.svn.wordpress.org/trunk@29430


git-svn-id: http://core.svn.wordpress.org/trunk@29208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-07 06:20:15 +00:00
parent b938bfb7d5
commit b053fe2e04
2 changed files with 4 additions and 2 deletions

View File

@ -71,7 +71,7 @@ function wp_underscore_video_template() {
}
if ( h ) {
h_rule = ' height: ' + h + 'px;';
h_rule = ' height: auto';
}
#>
<div style="max-width: 100%;{{ w_rule }}{{ h_rule }}">
@ -297,7 +297,7 @@ function wp_print_media_templates() {
w_rule = ' width: ' + wp.media.view.settings.contentWidth + 'px;';
}
if ( data.height ) {
h_rule = ' height: ' + data.height + 'px;';
h_rule = ' height: auto';
}
#>
<div style="max-width: 100%; {{ w_rule }}{{ h_rule }}" class="wp-media-wrapper">

View File

@ -1880,6 +1880,8 @@ function wp_video_shortcode( $attr, $content = '' ) {
}
if ( ! empty( $atts['height'] ) ) {
$height_rule = sprintf( ' height: %dpx;', $atts['height'] );
} else {
$height_rule = ' height: auto;';
}
$output = sprintf( '<div style="max-width: 100%%;%s%s" class="wp-video">%s</div>', $width_rule, $height_rule, $html );