FEATURE Passing the metiers and elements organised by aprent to the column
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nonimart 2025-07-31 15:02:32 +02:00
parent 70b0c7a89a
commit a869d6fbb2

View File

@ -86,7 +86,7 @@ function metiers_patrimoine_artisans_handle_posts_custom_columns($column)
if ($column == 'metiers') { if ($column == 'metiers') {
$terms = get_the_terms($post_id, 'metiers'); $terms = get_the_terms_organised_by_parent('metiers', $post_id);
if ($terms) { if ($terms) {
$parent_terms = array_filter($terms, function ($term) { $parent_terms = array_filter($terms, function ($term) {
return $term->parent == 0; return $term->parent == 0;
@ -107,7 +107,7 @@ function metiers_patrimoine_artisans_handle_posts_custom_columns($column)
} }
} }
if ($column == 'elements') { if ($column == 'elements') {
$terms = get_the_terms($post_id, 'elementsbatiments'); $terms = get_the_terms_organised_by_parent('elementsbatiments', $post_id);
if ($terms) { if ($terms) {
$parent_terms = array_filter($terms, function ($term) { $parent_terms = array_filter($terms, function ($term) {
return $term->parent == 0; return $term->parent == 0;