diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php index 1d6d987bb9f1c..c469c64978aa1 100644 --- a/src/wp-includes/media.php +++ b/src/wp-includes/media.php @@ -3415,8 +3415,13 @@ function wp_audio_shortcode( $attr, $content = '' ) { if ( ! empty( $atts[ $ext ] ) ) { $type = wp_check_filetype( $atts[ $ext ], wp_get_mime_types() ); + $ext_set_as_src = false; if ( strtolower( $type['ext'] ) === $ext ) { $primary = true; + if ( ! $ext_set_as_src ) { + $atts['src'] = $atts[ $ext ]; + $ext_set_as_src = true; + } } } } @@ -3467,6 +3472,7 @@ function wp_audio_shortcode( $attr, $content = '' ) { $html_atts = array( 'class' => $atts['class'], 'id' => sprintf( 'audio-%d-%d', $post_id, $instance ), + 'src' => $atts['src'], 'loop' => wp_validate_boolean( $atts['loop'] ), 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 'preload' => $atts['preload'],