Esempio n. 1
0
/**
 * Loads and displays the specified template using the same rules as eventrocket_template.
 *
 * If the optional $vars are provided those are extracted into the symbol table of the
 * included template.
 *
 * @param string $template
 * @param array  $vars
 */
function eventrocket_get_template($template, array $vars = array())
{
    $path = eventrocket_template($template);
    if (empty($path)) {
        return;
    }
    extract($vars);
    include $path;
}
 /**
  * Set the template to use.
  *
  * The template can live in the core The Events Calendar views directory, or else in the
  * theme/child theme, or can be an absolute path.
  */
 protected function set_template()
 {
     // If there is no template and no inner content, assume the regular single event template
     if (!isset($this->params['template']) && empty($this->content)) {
         $this->template = $this->fallback;
     } elseif (!isset($this->params['template'])) {
         return;
     }
     // If not an absolute filepath use Tribe's template finder
     if (isset($this->params['template']) && 0 !== strpos($this->params['template'], '/')) {
         $this->template = eventrocket_template($this->params['template']);
     }
     // Ensure the template exists
     if (!$this->template && file_exists($this->params['template'])) {
         $this->template = $this->params['template'];
     }
 }