From c788d119ba6407a4e9296b38b46f0bf2f6dafb33 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Tue, 18 Feb 2025 11:22:47 +0100 Subject: [PATCH] working on statutes --- includes/utilities.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/includes/utilities.php b/includes/utilities.php index fe71558..6a8d8b8 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -176,3 +176,26 @@ function getArtisanConseillerName($postID) $conseiller_name = $conseiller['user_firstname'] . ' ' . $conseiller['user_lastname']; return $conseiller_name; } + + +function translate_wordpress_online_statuses($post_status) +{ + $status_object = get_post_status_object($post_status); + + if ($post_status === 'publish') { + return 'En ligne'; + } + if ($post_status === 'draft') { + return 'Brouillon'; + } + if ($post_status === 'pending') { + return 'En attente'; + } + if ($post_status === 'offline') { + return 'Hors ligne'; + } + if ($post_status === 'trash') { + return 'Corbeille'; + } + return $status_object->label; +}