Escaping Dollar Sign in Live Template

I am attemtping to write a PHP Live Template for use with Advanced Custom Fields WordPress plugin.

I often find my self doing the following

$fieldname = get_field('fieldname');

I'd like to make a template like

$$VAR$ = get_field('$VAR0$');

However, that does not seem to work. Is there a way to escape the dolalr sign character?


1 comment
Comment actions Permalink

Have you tried using "Help" button?

If you need a dollar sign ($) in the template text, escape it by duplicating this character ($$).

Default PHP Live Templates "fore" and "forek" use it, so you could check them up in case if help was not unavailable for some reason.

$$$VAR$ = get_field('$VAR0$');


Please sign in to leave a comment.