Fires immediately after a post is deleted from the database. The dynamic portion of the hook name, `$post->post_type`, refers to the post type slug.
$post_id, $post
Sortie :
@param int $post_id Post ID. @param WP_Post $post Post object.
// Ajouter une fonction au hook action 'deleted_post_{$post->post_type}'
add_action('deleted_post_{$post->post_type}', 'ma_fonction_personnalisee', 10, 1);
function ma_fonction_personnalisee($post_id, $post) {
// Votre code ici
error_log('Hook deleted_post_{$post->post_type} déclenché');
}
Chargement des actualités...