Sets the status of a comment. The {@see 'wp_set_comment_status'} action is called after the comment is handled. If the comment status is not in the list, then false is returned.
Définit le statut d'un commentaire. L'action {@see 'wp_set_comment_status'} est appelée après le traitement du commentaire. Si le statut du commentaire n'est pas dans la liste, false est renvoyé.
$comment_id, $comment_status, $wp_error = false
Sortie :
@param int|WP_Comment $comment_id Comment ID or WP_Comment object. @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'. @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default false. @return bool|WP_Error True on success, false or WP_Error on failure.
add_action('wp_set_comment_status', 'log_comment_moderation', 10, 2);
function log_comment_moderation($comment_id, $status) {
error_log('Comment ' . $comment_id . ' status: ' . $status);
}
Chargement des actualités...