From c4fe4ebd429a104e14264fa1a9fec57eae427e7f Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Sun, 26 May 2013 05:55:49 +0000 Subject: [PATCH] Alias media.template to wp.template. See #23263, #24424. git-svn-id: http://core.svn.wordpress.org/trunk@24366 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/media-models.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/wp-includes/js/media-models.js b/wp-includes/js/media-models.js index a7674324bd..2f620d3a31 100644 --- a/wp-includes/js/media-models.js +++ b/wp-includes/js/media-models.js @@ -93,25 +93,9 @@ window.wp = window.wp || {}; * media.template( id ) * * Fetches a template by id. - * - * @param {string} id A string that corresponds to a DOM element with an id prefixed with "tmpl-". - * For example, "attachment" maps to "tmpl-attachment". - * @return {function} A function that lazily-compiles the template requested. + * See wp.template() in `wp-includes/js/wp-backbone.js`. */ - template: _.memoize( function( id ) { - var compiled, - options = { - evaluate: /<#([\s\S]+?)#>/g, - interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, - escape: /\{\{([^\}]+?)\}\}(?!\})/g, - variable: 'data' - }; - - return function( data ) { - compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options ); - return compiled( data ); - }; - }), + template: wp.template, /** * media.post( [action], [data] )