refactor: remove forum and topic feature chains

This commit is contained in:
2026-08-17 14:52:19 +08:00
parent 698e3750f9
commit 6c6c462df8
69 changed files with 339 additions and 2057 deletions
+1 -54
View File
@@ -67,7 +67,7 @@ trait FacadeBulk {
$types = [];
if (!empty($s['header_newposts_types']) && is_array($s['header_newposts_types'])) {
$types = array_values(array_filter(array_map('sanitize_key', $s['header_newposts_types'])));
$types = array_values(array_intersect(array_map('sanitize_key', $s['header_newposts_types']), ['post']));
}
// zibll nav_newposts_radius is bool pill; map true→20px, false→0. Legacy int still accepted once.
@@ -218,59 +218,6 @@ trait FacadeBulk {
'page_author_posts_per_page' => $author_per_page,
];
}
/**
* Special/topic page display settings.
*
* @return array
*/
public static function get_special_page_settings(): array {
$s = self::get_all();
$layout = sanitize_key((string) ($s['special_layout'] ?? 'grid'));
$source_type = sanitize_key((string) ($s['special_source_type'] ?? 'category'));
$subpage_display = sanitize_key((string) ($s['special_subpage_display'] ?? 'cards'));
$pagination = sanitize_key((string) ($s['special_pagination'] ?? 'numeric'));
$orderby = sanitize_key((string) ($s['special_orderby'] ?? 'date'));
if (!in_array($layout, ['grid', 'list', 'masonry'], true)) {
$layout = 'grid';
}
if (!in_array($source_type, ['category', 'tag', 'custom'], true)) {
$source_type = 'category';
}
if (!in_array($subpage_display, ['cards', 'list', 'grid'], true)) {
$subpage_display = 'cards';
}
if (!in_array($pagination, ['numeric', 'load_more', 'infinite'], true)) {
$pagination = 'numeric';
}
if (!in_array($orderby, ['date', 'modified', 'views', 'comments'], true)) {
$orderby = 'date';
}
return [
'cover_enabled' => !empty($s['special_cover_enabled']),
'summary_enabled' => !empty($s['special_summary_enabled']),
'summary_length' => max(50, min(500, (int) ($s['special_summary_length'] ?? 200))),
'default_cover' => esc_url_raw((string) ($s['special_default_cover'] ?? '')),
'layout' => $layout,
'columns' => max(1, min(4, (int) ($s['special_columns'] ?? 2))),
'source_type' => $source_type,
'source_ids' => trim((string) ($s['special_source_ids'] ?? '')),
'subpage_display' => $subpage_display,
'subpage_count' => max(1, min(20, (int) ($s['special_subpage_count'] ?? 6))),
'sidebar' => !empty($s['special_sidebar']),
'pagination' => $pagination,
'per_page' => max(4, min(48, (int) ($s['special_per_page'] ?? 12))),
'post_count' => !empty($s['special_post_count']),
'orderby' => $orderby,
];
}
/**
* Share and poster settings.
*