-
Notifications
You must be signed in to change notification settings - Fork 1
Tags Variable
Q edited this page Dec 13, 2020
·
2 revisions
Format: {{ [ filters ] variable }}
Variables are “placeholders” which are replaced by the data returned from the calling method, they are usually placed inside “Willow” tags or blocks, they accept [ filters ]
In the following simple example the variable {{ greeting }} is defined and populated with data returned from the class method ui::greeting():
{~ ui~greeting {+ <div>Willow says: {{ [ esc_html ] greeting }}</div> +} ~}
The data returned is modified using the WordPress escape function esc_html() because the [ esc_html ] filter was defined:
Return:
<div>Willow says: Isn't it a nice day</div>