X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/61343b82c4f0da4c68e4c6373daafff4a81efdd1..a7cd4c052013b423c6301153f68c7fdbaa2a447b:/wp-includes/media-template.php diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 6af7dc5f..758c7f5c 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -7,6 +7,115 @@ * @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 w_rule = h_rule = '', + w, h, settings = wp.media.view.settings, + isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/); + + if ( settings.contentWidth && data.model.width >= settings.contentWidth ) { + w = settings.contentWidth; + } else { + w = data.model.width; + } + + if ( w !== data.model.width ) { + h = Math.ceil( ( data.model.height * w ) / data.model.width ); + } else { + h = data.model.height; + } + + if ( w ) { + w_rule = 'width: ' + w + 'px; '; + } + if ( h ) { + h_rule = 'height: ' + h + 'px;'; + } +#> +
+ +
+ + + + + + - + + + + - + + - + + + + + + + + + + +