diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 8fa9afd9d4..d8d6423725 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -7,6 +7,99 @@ * @since 3.5.0 */ +/** + * Output the markup for a audio tag to be used in an Underscore template + * when data.model is passed. + * + * @since 3.9.0 + */ +function wp_underscore_audio_template() { + $audio_types = wp_get_audio_extensions(); +?> + + +<# +var isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/); + w = ! data.model.width || data.model.width > 640 ? 640 : data.model.width, + h = ! data.model.height ? 360 : data.model.height; + +if ( data.model.width && w !== data.model.width ) { + h = Math.ceil( ( h * w ) / data.model.width ); +} +#> +
+ +
+
{{{ wp.media.view.l10n.audioDetailsText }}}
- + + <# if ( ! _.isEmpty( data.model.src ) ) { #>