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;
}
}

View File

@@ -144,12 +144,12 @@ function thalim_get_single_data($post_id) {
$ancestor_ids = get_ancestors($cat->term_id, 'category');
if (!empty($ancestor_ids)) {
$root = get_category(end($ancestor_ids));
$data['parent_slug'] = $root->slug;
$data['parent_slug'] = thalim_category_color_slug($root->term_id, $root->slug);
$data['parent_name'] = $root->name;
$data['parent_link'] = get_category_link($root->term_id);
$data['category_name'] = $cat->name;
} else {
$data['parent_slug'] = $cat->slug;
$data['parent_slug'] = thalim_category_color_slug($cat->term_id, $cat->slug);
$data['parent_name'] = $cat->name;
$data['parent_link'] = get_category_link($cat->term_id);
$data['category_name'] = $lang === 'en' ? 'Other' : 'Autre';