diff --git a/src/filters.php b/src/filters.php index 4da33c2..66364fd 100644 --- a/src/filters.php +++ b/src/filters.php @@ -47,8 +47,8 @@ array_map(function ($type) { * Render page using Blade */ add_filter('template_include', function ($template) { - $data = array_reduce(get_body_class(), function ($data, $class) { - return apply_filters("sage/template/{$class}/data", $data); + $data = array_reduce(get_body_class(), function ($data, $class) use ($template) { + return apply_filters("sage/template/{$class}/data", $data, $template); }, []); echo template($template, $data);