Compile function.
public static compile ( array $filenames, array $data = [], boolean | integer $expires = false, string $cache_mode = Loader::CACHE_USE_DEFAULT, boolean $via_render = false ) : boolean | string | ||
$filenames | array | |
$data | array | |
$expires | boolean | integer | |
$cache_mode | string | |
$via_render | boolean | |
return | boolean | string |
/** * Logic for rendering this shortcode * * Note that we return the output of this shortcode. This is a requirement * by WordPress based on how do_shortcode works. * @return string * Compiled shortcode */ public function render($atts = array(), $content = null) { $template = $this->shortcode . '.twig'; if ($this->template !== null) { $template = $this->template; } $template = \apply_filters('shortcode_template', $template, $this->shortcode); if (class_exists('\\Timber\\Timber')) { return Timber::compile($template, $this->data); } else { include_once $template; } }