From 5d454ba8ed8f6d78787859bc1c5656de4e8491f7 Mon Sep 17 00:00:00 2001 From: QWp6t Date: Sat, 24 Dec 2016 04:42:05 -0800 Subject: [PATCH] Remove `templates/` when normalizing templates in hierarchy filters --- src/filters.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters.php b/src/filters.php index 66364fd..3d7789c 100644 --- a/src/filters.php +++ b/src/filters.php @@ -34,7 +34,7 @@ add_filter('excerpt_more', function () { array_map(function ($type) { add_filter("{$type}_template_hierarchy", function ($templates) { return call_user_func_array('array_merge', array_map(function ($template) { - $normalizedTemplate = preg_replace('%(\.blade)?(\.php)?$%', '', $template); + $normalizedTemplate = preg_replace(['%^/?(templates)?/?%', '%(\.blade)?(\.php)?$%'], '', $template); return ["{$normalizedTemplate}.blade.php", "{$normalizedTemplate}.php"]; }, $templates)); });