diff --git a/wp-includes/js/media-models.js b/wp-includes/js/media-models.js index 0b0790f54d..b7ab0c4573 100644 --- a/wp-includes/js/media-models.js +++ b/wp-includes/js/media-models.js @@ -80,7 +80,8 @@ window.wp = window.wp || {}; options = { evaluate: /<#([\s\S]+?)#>/g, interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, - escape: /\{\{([^\}]+?)\}\}(?!\})/g + escape: /\{\{([^\}]+?)\}\}(?!\})/g, + variable: 'data' }; return function( data ) { diff --git a/wp-includes/media.php b/wp-includes/media.php index 64810e19f3..145ec45bed 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1390,7 +1390,7 @@ function wp_print_media_templates( $attachment ) { ?> @@ -1465,50 +1465,50 @@ function wp_print_media_templates( $attachment ) {

- <# if ( uploading ) { #> + <# if ( data.uploading ) { #>
- <# } else if ( 'image' === type ) { #> - + <# } else if ( 'image' === data.type ) { #> + <# } else { #> - + <# } #>
-
{{ filename }}
-
{{ dateFormatted }}
- <# if ( 'image' === type && ! uploading ) { #> -
{{ width }} × {{ height }}
+
{{ data.filename }}
+
{{ data.dateFormatted }}
+ <# if ( 'image' === data.type && ! data.uploading ) { #> +
{{ data.width }} × {{ data.height }}
<# } #>
- <# if ( compat && compat.meta ) { #> - {{{ compat.meta }}} + <# if ( data.compat && data.compat.meta ) { #> + {{{ data.compat.meta }}} <# } #>
- <# if ( 'image' === type ) { #> + <# if ( 'image' === data.type ) { #> <# } else { #>