update_comment_history example

    // because we don't know the comment ID at that point.     public static function auto_check_update_meta( $id$comment ) {
        // wp_insert_comment() might be called in other contexts, so make sure this is the same comment         // as was checked by auto_check_comment         if ( is_object( $comment ) && !empty( self::$last_comment ) && is_array( self::$last_comment ) ) {
            if ( self::matches_last_comment( $comment ) ) {
                load_plugin_textdomain( 'akismet' );

                // normal result: true or false                 if ( self::$last_comment['akismet_result'] == 'true' ) {
                    update_comment_meta( $comment->comment_ID, 'akismet_result', 'true' );
                    self::update_comment_history( $comment->comment_ID, '', 'check-spam' );
                    if ( $comment->comment_approved != 'spam' ) {
                        self::update_comment_history(
                            $comment->comment_ID,
                            '',
                            'status-changed-' . $comment->comment_approved
                        );
                    }
                } elseif ( self::$last_comment['akismet_result'] == 'false' ) {
                    update_comment_meta( $comment->comment_ID, 'akismet_result', 'false' );
                    self::update_comment_history( $comment->comment_ID, '', 'check-ham' );
                    // Status could be spam or trash, depending on the WP version and whether this change applies:

function akismet_result_spam( $approved ) {
    return Akismet::comment_is_spam( $approved );
}
function akismet_result_hold( $approved ) {
    return Akismet::comment_needs_moderation( $approved );
}
function akismet_get_user_comments_approved( $user_id$comment_author_email$comment_author$comment_author_url ) {
    return Akismet::get_user_comments_approved( $user_id$comment_author_email$comment_author$comment_author_url );
}
function akismet_update_comment_history( $comment_id$message$event = null ) {
    return Akismet::update_comment_history( $comment_id$message$event );
}
function akismet_get_comment_history( $comment_id ) {
    return Akismet::get_comment_history( $comment_id );
}
function akismet_cmp_time( $a$b ) {
    return Akismet::_cmp_time( $a$b );
}
function akismet_auto_check_update_meta( $id$comment ) {
    return Akismet::auto_check_update_meta( $id$comment );
}
function akismet_auto_check_comment( $commentdata ) {
    
Home | Imprint | This part of the site doesn't use cookies.