working on statutes

This commit is contained in:
Antoine M 2025-02-18 11:22:47 +01:00
parent 30d9074f14
commit c788d119ba

View File

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