Skip to content

Commit

Permalink
Merge pull request #2100 from mejta/comments-template-data
Browse files Browse the repository at this point in the history
Add data from controller to comments template
  • Loading branch information
retlehs authored Sep 7, 2018
2 parents 798e1a2 + 190e828 commit b8c0ebc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@
$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';
}

Expand Down

0 comments on commit b8c0ebc

Please sign in to comment.