From 1178028bfbb0c477c208b644f03c9b8f055ae1e6 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 16 May 2025 10:39:47 +0200 Subject: [PATCH] FEATURE Handling Custom updated messages with artisan url for post type chantiers --- includes/chantiers.php | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/includes/chantiers.php b/includes/chantiers.php index 8613d86..da0115a 100644 --- a/includes/chantiers.php +++ b/includes/chantiers.php @@ -1,5 +1,9 @@ ID); + + if ($post_type === 'chantiers' && $artisan->ID) { + $artisan_link = get_the_permalink($artisan->ID); + + $messages[$post_type][1] = 'Chantier mis à jour. Voir sur la fiche de l\'artisan'; + $messages[$post_type][6] = 'Chantier publié. Voir sur la fiche de l\'artisan'; + } + + return $messages; +} +add_filter('post_updated_messages', 'chantiers_post_updated_messages'); + + + + /* ----------------------------------------- EDIT ARTISAN LINK ON CHANTIER EDIT PAGE -----------------------------------------*/ @@ -135,9 +165,9 @@ add_action('edit_form_after_title', function () { ?>
- ' /> Retour vers la fiche de l’artisan + ' /> Retour vers la fiche de l'artisan - ' /> Retour vers la fiche de l’artisan + ' /> Retour vers la fiche de l'artisan