Skip to content

Commit e68d167

Browse files
committed
do not swallow the existing templates in the theme folder
1 parent f6980fe commit e68d167

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/config/template.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
function filter_templates($templates)
1010
{
1111
if (!defined('WP_TEMPLATE_DIR')) {
12-
return [];
12+
return $templates;
1313
}
1414

1515
if (!$type = get_post_type()) {
16-
return [];
16+
return $templates;
1717
}
1818

1919

2020
$path = WP_TEMPLATE_DIR.$type;
2121

2222
if (!is_dir($path)) {
23-
return [];
23+
return $templates;
2424
}
2525

2626
$filtered = array_filter(scandir($path), function ($item) {
@@ -31,5 +31,5 @@ function filter_templates($templates)
3131
return str_replace(".blade.php", "", $item);
3232
}, $filtered);
3333

34-
return array_combine($list, $list);
34+
return array_merge($templates, array_combine($list, $list));
3535
}

0 commit comments

Comments
 (0)