Ticket #36695: 36695.2.diff
File 36695.2.diff, 889 bytes (added by , 9 years ago) |
---|
-
src/wp-includes/js/wp-util.js
14 14 * For example, "attachment" maps to "tmpl-attachment". 15 15 * @return {function} A function that lazily-compiles the template requested. 16 16 */ 17 wp.template = _.memoize(function 17 wp.template = _.memoize(function( id ) { 18 18 var compiled, 19 19 /* 20 20 * Underscore's default ERB-style templates are incompatible with PHP … … 29 29 variable: 'data' 30 30 }; 31 31 32 return function 33 compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null,options );32 return function( data ) { 33 compiled = compiled || _.template( $( '#tmpl-' + id ).html(), options ); 34 34 return compiled( data ); 35 35 }; 36 36 });