Skip to content

Commit

Permalink
Wrap templates located outside the theme
Browse files Browse the repository at this point in the history
Wrapper will now pass through $template if locate_template() turns up zero
results.
  • Loading branch information
QWp6t committed Jul 14, 2016
1 parent ca4db00 commit 4435d52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/filters.php
Expand Up @@ -49,5 +49,5 @@
if (!is_string($main) || !(string) $main) {
return $main;
}
return template_wrap(new Wrapper(basename($main)));
return template_wrap(new Wrapper($main));
}, 109);
2 changes: 1 addition & 1 deletion src/lib/Sage/Template/Wrapper.php
Expand Up @@ -60,6 +60,6 @@ public function getSlug()
public function getTemplate()
{
$template = apply_filters('sage/unwrap_' . $this->slug, $this->template) ?: $this->template;
return locate_template($template);
return locate_template($template) ?: $template;
}
}

0 comments on commit 4435d52

Please sign in to comment.