trash_comment

ACTION wp-includes\comment.php (ligne 1625) github
Fires immediately before a comment is sent to the Trash.

Paramètres

Entrée :
$comment->comment_ID, $comment
Sortie :
@param string     $comment_id The comment ID as a numeric string.
@param WP_Comment $comment    The comment to be trashed.

Utilisation

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

function ma_fonction_personnalisee($comment->comment_ID, $comment) {
    // Votre code ici
    error_log('Hook trash_comment déclenché');
}

Actualités

Chargement des actualités...