Media: Remove extra space from the `width` attribute in `wp_playlist_shortcode()` output.

Props hvar.
Fixes #50840.

git-svn-id: https://develop.svn.wordpress.org/trunk@48716 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-08-04 12:45:57 +00:00
parent 59ed4cbfc1
commit 42dc935f9f
1 changed files with 15 additions and 16 deletions

View File

@ -2685,28 +2685,24 @@ function wp_playlist_shortcode( $attr ) {
?> ?>
<div class="wp-playlist wp-<?php echo $safe_type; ?>-playlist wp-playlist-<?php echo $safe_style; ?>"> <div class="wp-playlist wp-<?php echo $safe_type; ?>-playlist wp-playlist-<?php echo $safe_style; ?>">
<?php if ( 'audio' === $atts['type'] ) : ?> <?php if ( 'audio' === $atts['type'] ) : ?>
<div class="wp-playlist-current-item"></div> <div class="wp-playlist-current-item"></div>
<?php endif ?> <?php endif ?>
<<?php echo $safe_type; ?> controls="controls" preload="none" width=" <<?php echo $safe_type; ?> controls="controls" preload="none" width="<?php echo (int) $theme_width; ?>"
<?php <?php
echo (int) $theme_width; if ( 'video' === $safe_type ) {
?> echo ' height="', (int) $theme_height, '"';
" }
<?php ?>
if ( 'video' === $safe_type ) :
echo ' height="', (int) $theme_height, '"';
endif;
?>
></<?php echo $safe_type; ?>> ></<?php echo $safe_type; ?>>
<div class="wp-playlist-next"></div> <div class="wp-playlist-next"></div>
<div class="wp-playlist-prev"></div> <div class="wp-playlist-prev"></div>
<noscript> <noscript>
<ol> <ol>
<?php <?php
foreach ( $attachments as $att_id => $attachment ) { foreach ( $attachments as $att_id => $attachment ) {
printf( '<li>%s</li>', wp_get_attachment_link( $att_id ) ); printf( '<li>%s</li>', wp_get_attachment_link( $att_id ) );
} }
?> ?>
</ol> </ol>
</noscript> </noscript>
<script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode( $data ); ?></script> <script type="application/json" class="wp-playlist-script"><?php echo wp_json_encode( $data ); ?></script>
@ -3207,13 +3203,16 @@ function wp_video_shortcode( $attr, $content = '' ) {
} }
$html = ''; $html = '';
if ( 'mediaelement' === $library && 1 === $instance ) { if ( 'mediaelement' === $library && 1 === $instance ) {
$html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n"; $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n";
} }
$html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) ); $html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) );
$fileurl = ''; $fileurl = '';
$source = '<source type="%s" src="%s" />'; $source = '<source type="%s" src="%s" />';
foreach ( $default_types as $fallback ) { foreach ( $default_types as $fallback ) {
if ( ! empty( $atts[ $fallback ] ) ) { if ( ! empty( $atts[ $fallback ] ) ) {
if ( empty( $fileurl ) ) { if ( empty( $fileurl ) ) {