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 -23
View File
@@ -258,7 +258,7 @@ class GlobalController extends ControllerBase {
if ($term_id > 0) {
$term = get_term($term_id);
$taxonomy = ($term && !is_wp_error($term)) ? (string) $term->taxonomy : 'category';
if (!in_array($taxonomy, ['category', 'topics'], true)) {
if ($taxonomy !== 'category') {
$taxonomy = 'category';
}
$args['tax_query'] = [[
@@ -350,28 +350,6 @@ class GlobalController extends ControllerBase {
];
}
if (taxonomy_exists('topics')) {
$topics = get_terms([
'taxonomy' => 'topics',
'hide_empty' => false,
'orderby' => 'name',
'order' => 'ASC',
]);
if (!is_wp_error($topics)) {
foreach ($topics as $term) {
$data[] = [
'id' => (int) $term->term_id,
'term_id' => (int) $term->term_id,
'name' => $term->name,
'slug' => $term->slug,
'count' => (int) $term->count,
'parent' => (int) $term->parent,
'taxonomy' => 'topics',
];
}
}
}
return $this->success(['data' => $data]);
}