From 3258bff64eae7aea73746371bc5155fc3a48668b Mon Sep 17 00:00:00 2001 From: QWp6t Date: Sun, 18 Dec 2016 16:00:00 -0800 Subject: [PATCH] Pass `$template` to `sage/template/{$class}/data` filter, closes #1771 --- src/filters.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);