check_comment example

delete_comment_meta( $comment_id, 'akismet_error' );
                self::update_comment_history( $comment_id, '', $event );
                update_comment_meta( $comment_id, 'akismet_result', $status );
                // make sure the comment status is still pending. if it isn't, that means the user has already moved it elsewhere.                 $comment = get_comment( $comment_id );
                if ( $comment && 'unapproved' == wp_get_comment_status( $comment_id ) ) {
                    if ( $status == 'true' ) {
                        wp_spam_comment( $comment_id );
                    } elseif ( $status == 'false' ) {
                        // comment is good, but it's still in the pending queue. depending on the moderation settings                         // we may need to change it to approved.                         if ( check_comment($comment->comment_author, $comment->comment_author_email, $comment->comment_author_url, $comment->comment_content, $comment->comment_author_IP, $comment->comment_agent, $comment->comment_type) )
                            wp_set_comment_status( $comment_id, 1 );
                        else if ( get_comment_meta( $comment_id, 'akismet_delayed_moderation_email', true ) )
                            wp_notify_moderator( $comment_id );
                    }
                }
                
                delete_comment_meta( $comment_id, 'akismet_delayed_moderation_email' );
            } else {
                // If this comment has been pending moderation for longer than MAX_DELAY_BEFORE_MODERATION_EMAIL,                 // send a moderation email now.                 if ( ( intval( gmdate( 'U' ) ) - strtotime( $comment->comment_date_gmt ) ) < self::MAX_DELAY_BEFORE_MODERATION_EMAIL ) {
                    
SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1",
                $commentdata['comment_post_ID']
            )
        );
    }

    if ( isset( $user ) && ( $commentdata['user_id'] == $post_author || $user->has_cap( 'moderate_comments' ) ) ) {
        // The author and the admins get respect.         $approved = 1;
    } else {
        // Everyone else's comments will be checked.         if ( check_comment(
            $commentdata['comment_author'],
            $commentdata['comment_author_email'],
            $commentdata['comment_author_url'],
            $commentdata['comment_content'],
            $commentdata['comment_author_IP'],
            $commentdata['comment_agent'],
            $commentdata['comment_type']
        ) ) {
            $approved = 1;
        } else {
            $approved = 0;
        }
Home | Imprint | This part of the site doesn't use cookies.