comment_post

ACTION wp-includes\comment.php (ligne 2430) github
Fires immediately after a comment is inserted into the database.

Paramètres

Entrée :
$comment_id, $commentdata['comment_approved'], $commentdata
Sortie :
@param int        $comment_id       The comment ID.
@param int|string $comment_approved 1 if the comment is approved, 0 if not, 'spam' if spam.
@param array      $commentdata      Comment data.

Utilisation

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

function ma_fonction_personnalisee($comment_id, $commentdata['comment_approved'], $commentdata) {
    // Votre code ici
    error_log('Hook comment_post déclenché');
}

Actualités

Chargement des actualités...