pre_comment_on_post

ACTION wp-includes\comment.php (ligne 3733) github
Fires before a comment is posted.

Paramètres

Entrée :
$comment_post_id
Sortie :
@param int $comment_post_id Post ID.

Utilisation

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

function ma_fonction_personnalisee($comment_post_id) {
    // Votre code ici
    error_log('Hook pre_comment_on_post déclenché');
}

Actualités

Chargement des actualités...