Make WordPress Core

Changeset 24366


Ignore:
Timestamp:
05/26/2013 05:55:49 AM (13 years ago)
Author:
koopersmith
Message:

Alias media.template to wp.template. See #23263, #24424.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/media-models.js

    r24110 r24366  
    9494                 *
    9595                 * Fetches a template by id.
    96                  *
    97                  * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-".
    98                  *                       For example, "attachment" maps to "tmpl-attachment".
    99                  * @return {function}    A function that lazily-compiles the template requested.
     96                 * See wp.template() in `wp-includes/js/wp-backbone.js`.
    10097                 */
    101                 template: _.memoize( function( id ) {
    102                         var compiled,
    103                                 options = {
    104                                         evaluate:    /<#([\s\S]+?)#>/g,
    105                                         interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
    106                                         escape:      /\{\{([^\}]+?)\}\}(?!\})/g,
    107                                         variable:    'data'
    108                                 };
    109 
    110                         return function( data ) {
    111                                 compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options );
    112                                 return compiled( data );
    113                         };
    114                 }),
     98                template: wp.template,
    11599
    116100                /**
Note: See TracChangeset for help on using the changeset viewer.