FIX Update handling of 'revue' column in articles to display a placeholder when no related revue is set.

This commit is contained in:
Antoine M 2025-05-23 18:06:53 +02:00
parent f30f8efa74
commit d6938cea56

View File

@ -33,10 +33,12 @@ function carhop_articles_handle_posts_custom_columns($column)
if ($column == 'revue') { if ($column == 'revue') {
$revue_id = get_field('related_revue', $post_id); $revue_id = get_field('related_revue', $post_id);
if (!isset($revue_id)) return; if (!isset($revue_id)) {
echo '—';
} else {
$revue_title = get_the_title($revue_id); $revue_title = get_the_title($revue_id);
echo $revue_title; echo $revue_title;
} }
} }
}
add_action('manage_articles_posts_custom_column', 'carhop_articles_handle_posts_custom_columns', 10, 2); add_action('manage_articles_posts_custom_column', 'carhop_articles_handle_posts_custom_columns', 10, 2);