I’ve been trying to Google to find this solution but am still uncertain. Can anyone help me out?
This is the most probably solution I’ve found, but I’m still not sure if it’s correct:
https://stackoverflow.com/questions/17878560/difference-between-double-and-single-curly-brace-in-angular-js
{{}} are Angular expressions and come quite handy when you wish to write stuff to HTML
Knowing that WordPress incorporates mediaelement.js
for it’s media playback (I am not sure if it’s related to Angular.js)..
Let’s take an excerpt from the wp_underscore_playlist_templates
<script type="text/html" id="tmpl-wp-playlist-current-item">
<# if ( data.image ) { #>
<img src="https://wordpress.stackexchange.com/questions/239619/{{ data.thumb.src }}"/>
<# } #>
<div class="wp-playlist-caption">
<span class="wp-playlist-item-meta wp-playlist-item-title">{{ data.title }}</span>
<# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #>
<# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #>
</div>
What I’m trying to do is customize this playlist template and add my own variables.
But I’m used to dealing with WordPress and PHP $variables
.
What kind of variables are these and where in WordPress are they defined? data.image
data.thumb.src
data.title
data.meta.album
data.meta.artist
etc.