FEAT commenting code due to return button handled elsewhere

This commit is contained in:
Antoine M 2025-04-07 12:18:55 +02:00
parent 33c6139a0e
commit 68d9462d22

View File

@ -32,22 +32,22 @@ add_action('acf/save_post', 'metiers_patrimoine_chantiers_post_updater', 20);
EDIT ARTISAN LINK ON CHANTIER EDIT PAGE EDIT ARTISAN LINK ON CHANTIER EDIT PAGE
-----------------------------------------*/ -----------------------------------------*/
add_action('acf/render_field', function ($field) { // add_action('acf/render_field', function ($field) {
// Vérifiez si le champ est celui que vous voulez personnaliser // // Vérifiez si le champ est celui que vous voulez personnaliser
if ($field['key'] === 'field_6719065f58122') { // if ($field['key'] === 'field_6719065f58122') {
if (did_action('acf/render_field/key=field_6719065f58122') % 2 === 0) { // if (did_action('acf/render_field/key=field_6719065f58122') % 2 === 0) {
return; // return;
} // }
$field['rendered'] = true; // $field['rendered'] = true;
$linked_post_id = get_field($field['key']); // $linked_post_id = get_field($field['key']);
if ($linked_post_id) { // if ($linked_post_id) {
$edit_link = get_edit_post_link($linked_post_id); // $edit_link = get_edit_post_link($linked_post_id);
echo '<a href="' . esc_url($edit_link) . '" class="edit-fiche-artisan-link"><img src=' . get_stylesheet_directory_uri() . '/resources/img/icons/tools.svg' . ' /> Voir la fiche de l\'artisan </a>'; // echo '<a href="' . esc_url($edit_link) . '" class="edit-fiche-artisan-link"><img src=' . get_stylesheet_directory_uri() . '/resources/img/icons/tools.svg' . ' /> Voir la fiche de l\'artisan </a>';
} // }
} // }
}, 10, 1); // }, 10, 1);