deleted_post_{$post->post_type}

ACTION wp-includes\post.php (ligne 3925) github
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.

Paramètres

Entrée :
$post_id, $post
Sortie :
@param int     $post_id Post ID.
@param WP_Post $post    Post object.

Utilisation

// 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é');
}

Actualités

Chargement des actualités...