]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/wp-util.js
WordPress 4.1
[autoinstalls/wordpress.git] / wp-includes / js / wp-util.js
index 867d3a08e43cd12e0e041ce6e0ac3d503d1aa186..1985b35e6fdb29c2675b4c343fa51f0e44580b3f 100644 (file)
@@ -8,7 +8,7 @@ window.wp = window.wp || {};
        /**
         * wp.template( id )
         *
        /**
         * wp.template( id )
         *
-        * Fetches a template by id.
+        * Fetch a JavaScript template for an id, and return a templating function for it.
         *
         * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-".
         *                       For example, "attachment" maps to "tmpl-attachment".
         *
         * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-".
         *                       For example, "attachment" maps to "tmpl-attachment".
@@ -16,6 +16,12 @@ window.wp = window.wp || {};
         */
        wp.template = _.memoize(function ( id ) {
                var compiled,
         */
        wp.template = _.memoize(function ( id ) {
                var compiled,
+                       /*
+                        * Underscore's default ERB-style templates are incompatible with PHP
+                        * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
+                        *
+                        * @see trac ticket #22344.
+                        */
                        options = {
                                evaluate:    /<#([\s\S]+?)#>/g,
                                interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
                        options = {
                                evaluate:    /<#([\s\S]+?)#>/g,
                                interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,