correction doublons index Ajax + découplage slug categories couleurs

This commit is contained in:
2026-06-04 17:41:11 +02:00
parent d900e7aa65
commit bea33f9fd3
5 changed files with 92 additions and 36 deletions

View File

@@ -99,7 +99,7 @@ function thalim_get_card_data($post_id) {
} else {
$root = $cat;
}
$data['parent_slug'] = $root->slug;
$data['parent_slug'] = thalim_category_color_slug($root->term_id, $root->slug);
$data['card_category_name'] = thalim_cat_name($cat);
$data['card_category_url'] = get_category_link($cat->term_id);
break;
@@ -132,7 +132,7 @@ function thalim_get_card_data($post_id) {
if (in_array($cat->term_id, $excluded_ids)) continue;
$ancestor_ids = get_ancestors($cat->term_id, 'category');
$root = !empty($ancestor_ids) ? get_category(end($ancestor_ids)) : $cat;
$data['parent_slug'] = $root->slug;
$data['parent_slug'] = thalim_category_color_slug($root->term_id, $root->slug);
break;
}
}