diff --git a/includes/chantiers.php b/includes/chantiers.php index 29f2b5d..87cee9e 100644 --- a/includes/chantiers.php +++ b/includes/chantiers.php @@ -119,3 +119,25 @@ function metiers_patrimoine_orderby($query) } } add_action('pre_get_posts', 'metiers_patrimoine_orderby'); + + + +/* --------------------------------------- +CUSTOM CONTENT AFTER POST TYPE TITLE +------------------------------------------*/ +add_action('edit_form_after_title', function () { + $screen = get_current_screen(); + + if ($screen && $screen->post_type === 'chantiers') { + $linked_artisan_id = get_field('artisan'); + $return_to = isset($_GET['return_to']) ? $_GET['return_to'] : ''; + $edit_artisan_link = get_edit_post_link($linked_artisan_id); +?> + + ' /> Voir la fiche de l'artisan + + ' /> Voir la fiche de l'artisan + +