How to use code editor

HTML mode

In this mode, you can only use HTML code and a specific set of variables. The set of variables depends on the added attributes. For example, if you add the attribute 'color', you can use the variable {{color}} in your code. Independently of added attributes, you can use the variable {{content}}, which will be replaced by the contents of the shortcode (the text between the opening and closing shortcode tags).

Example code

{{content}}

PHP return

This mode is a bit complicated than the previous. Using this mode, you need to write code in PHP. The output of the code must be returned, but not displayed. To do this, use 'return' operator. In this mode you can not use functions such as print_r, echo or die. If you do not understand the difference between the return and echo in PHP, then better to use the HTML mode or PHP echo.

All added attributes are available as variables. For example, if you add an attribute with short name 'color', then the code can use a variable named $color. Variable $content will contain actual shortcode content (the text between the opening and closing shortcode tags).

Example code

return '' . $content . '';

PHP echo

This mode is similar to the previous (PHP return). However, in this mode you can use any of the functions and operators that display text. It is recommended to use the echo statement to output the code. All attributes are available as variables.

Example code

echo '' . $content . '';