$shortcodes
$shortcodes : array
Array holding the shortcodes of this template
A class to represent shortcode templates.
$shortcodes : array
Array holding the shortcodes of this template
__construct(string $template, array $shortcodes)
Construct a shortcode template.
string | $template | The template containing a subset of the shortcodes. |
array | $shortcodes | Array whose keys are the shortcodes inclosed in [...] and whose values are associative arrays containing a 'description' and an 'example' value for the shortcode. |
expand(array $replacements, boolean $error_if_not_all_appearing_specified = true) : string
Return the expanded version of the template
array | $replacements | Array of strings with which to replace the shortcodes. Must be either an array of the same length as $shortcodes or have a subset of shortcodes as array keys and their replacements as values. |
boolean | $error_if_not_all_appearing_specified | Throw an exception if template contains shortcodes for which no value was provided (default true). |
The expanded template.