fix(page-display): connect header component visibility settings

This commit is contained in:
2026-08-19 13:35:31 +08:00
parent 8a738c7998
commit d4a9b7fd98
8 changed files with 152 additions and 34 deletions
+6 -1
View File
@@ -56,13 +56,18 @@ trait DisplayPageGroups {
'category',
'tag',
'author',
'user_center',
'single',
'search',
'page',
];
$show_on = isset($s['header_slider_show']) ? (array) $s['header_slider_show'] : [];
$show_on = array_map(static function ($type): string {
$type = sanitize_key((string) $type);
return $type === 'user_home' ? 'author' : $type;
}, $show_on);
$show_on = array_values(array_intersect(
array_map('sanitize_key', $show_on),
$show_on,
$allowed_page_types
));
$show_type = $s['header_slider_show_type'] ?? '';