feat(topics): restore topic taxonomy workflow

This commit is contained in:
kate522 committed 2026-11-10 22:31:11 +08:00
1 parent f3dd1ec3b1
commit a254cbd3e9
59 files changed
+771 -192

No files matched your search

@@ -110,7 +110,7 @@ final class ContentRenderer {
if (!$term_ids) {
return '';
}
$terms = get_terms(['taxonomy' => 'category', 'include' => $term_ids, 'orderby' => 'include']);
$terms = get_terms(['taxonomy' => ['category', 'topics'], 'include' => $term_ids, 'orderby' => 'include']);
if (is_wp_error($terms) || !$terms) {
return '';
}
@@ -134,7 +134,7 @@ final class ContentRenderer {
$card = [
'type' => (string) ($instance['type'] ?? 'style-1'),
'class' => 'mb10',
'img' => jio_widget_term_cover_url((int) $term->term_id),
'img' => jio_widget_term_cover_url((int) $term->term_id, false, (string) $term->taxonomy),
'alt' => $name . '-' . $description,
'link' => ['url' => esc_url((string) $href), 'target' => $target_blank],
'text1' => $name,
@@ -179,8 +179,13 @@ final class ContentRenderer {
$animation = (string) ($instance['obs_animation'] ?? '');
$html = '';
foreach ($term_ids as $key => $term_id) {
$term = get_term((int) $term_id);
if (!$term instanceof \WP_Term || !in_array($term->taxonomy, ['category', 'topics'], true)) {
continue;
}
$card = jio_widget_term_aggregation([
'term_id' => (int) $term_id,
'taxonomy' => (string) $term->taxonomy,
'target_blank' => !empty($instance['target_blank']),
'orderby' => (string) ($instance['orderby'] ?? 'modified'),
'order' => (($instance['order'] ?? 'desc') === 'asc') ? 'ASC' : 'DESC',