Merge pull request #2100 from mejta/comments-template-data

Add data from controller to comments template
This commit is contained in:
Ben Word
2018-09-06 19:14:22 -06:00
committed by GitHub

View File

@@ -72,10 +72,14 @@ add_filter('comments_template', function ($comments_template) {
$comments_template
);
$data = collect(get_body_class())->reduce(function ($data, $class) use ($comments_template) {
return apply_filters("sage/template/{$class}/data", $data, $comments_template);
}, []);
$theme_template = locate_template(["views/{$comments_template}", $comments_template]);
if ($theme_template) {
echo template($theme_template);
echo template($theme_template, $data);
return get_stylesheet_directory().'/index.php';
}