From d6938cea5654ab3085cbd2a5a54a68f8626987b7 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 23 May 2025 18:06:53 +0200 Subject: [PATCH] FIX Update handling of 'revue' column in articles to display a placeholder when no related revue is set. --- includes/columns.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/columns.php b/includes/columns.php index b148c8c..2a6e952 100644 --- a/includes/columns.php +++ b/includes/columns.php @@ -33,10 +33,12 @@ function carhop_articles_handle_posts_custom_columns($column) if ($column == 'revue') { $revue_id = get_field('related_revue', $post_id); - if (!isset($revue_id)) return; - - $revue_title = get_the_title($revue_id); - echo $revue_title; + if (!isset($revue_id)) { + echo '—'; + } else { + $revue_title = get_the_title($revue_id); + echo $revue_title; + } } } add_action('manage_articles_posts_custom_column', 'carhop_articles_handle_posts_custom_columns', 10, 2);