wp/wp-includes/js/wp-util.js
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
--- a/wp/wp-includes/js/wp-util.js	Mon Jun 08 16:11:51 2015 +0000
+++ b/wp/wp-includes/js/wp-util.js	Tue Jun 09 03:35:32 2015 +0200
@@ -1,3 +1,4 @@
+/* global _wpUtilSettings */
 window.wp = window.wp || {};
 
 (function ($) {
@@ -7,7 +8,7 @@
 	/**
 	 * 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".
@@ -15,6 +16,12 @@
 	 */
 	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,