{{ Double Curly Brace }} data.____ Variable Source in WP_Playlist Template

Those are the Mustache-inspired syntax you are talking about. That can be acheived using wp.template WordPress function.
The script you showing is javascript templating in WordPress

  • wp.template() is a cool little JavaScript utility method
  • WordPress uses this utility to load templates for all of the backbone views, but backbone is not required to use it.
  • Because all of WordPress uses this templating method/system, you will want to make sure you properly prefix your ids, so as not to conflict with another template that may be loaded on the page. That script tag should also have a type of “text/template
  • WordPress-specific interpolation syntax is inspired by Mustache templating

    syntax:
    Interpolate (unescaped): {{{ }}}
    Interpolate (escaped): {{ }}
    Evaluate: <# #>

For Reference:

 - https://lkwdwrd.com/wp-template-js-templates-wp/ 
 - https://codex.wordpress.org/Javascript_Reference/wp.template 

Hope that helps!!

Leave a Comment