untrashed_post

ACTION wp-includes\post.php (ligne 4177) github
Fires after a post is restored from the Trash.

Paramètres

Entrée :
$post_id, $previous_status
Sortie :
@param int    $post_id         Post ID.
@param string $previous_status The status of the post at the point where it was trashed.

Utilisation

// Ajouter une fonction au hook action 'untrashed_post'
add_action('untrashed_post', 'ma_fonction_personnalisee', 10, 1);

function ma_fonction_personnalisee($post_id, $previous_status) {
    // Votre code ici
    error_log('Hook untrashed_post déclenché');
}

Actualités

Chargement des actualités...