Php code inside of strange Tags <# #>

I am currently working on a WordPress page that uses the OnePress theme (Link). Inside the customizer-controls.php file I found this:

<div class="widget-content">
    <# var cond_v; #>
    <# for ( i in data ) { #>
    <# if ( ! data.hasOwnProperty( i ) ) continue; #>
    <# field = data[i]; #>
    <# if ( ! field.type ) continue; #>
...

It looks like normal php logic but inside this strange tags <# #>. Can someone tell me what this is?

Related posts

1 comment

  1. It’s Underscore JS code, but using a Mustache inspired syntax for the tagging.

    This is because Underscore’s default ERB-style templates are incompatible with PHP when asp_tags is enabled. This means that using <% %> in PHP can break on some sites.

    See https://core.trac.wordpress.org/ticket/22344 for more information as to why this is done in WordPress.

Comments are closed.