akismet_check_db_comment

Definition:
function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {}

Parameters

  • $id
  • $recheck_reason

Source code

function akismet_check_db_comment( $id, $recheck_reason = 'recheck_queue' ) {

    global $wpdb, $akismet_api_host, $akismet_api_port;



    $id = (int) $id;

    $c = $wpdb->get_row( "SELECT * FROM $wpdb->comments WHERE comment_ID = '$id'", ARRAY_A );

    if ( !$c )

        return;



    $c['user_ip']    = $c['comment_author_IP'];

    $c['user_agent'] = $c['comment_agent'];

    $c['referrer']   = '';

    $c['blog']       = get_option('home');

    $c['blog_lang']  = get_locale();

    $c['blog_charset'] = get_option('blog_charset');

    $c['permalink']  = get_permalink($c['comment_post_ID']);

    $id = $c['comment_ID'];

	if ( akismet_test_mode() )

		$c['is_test'] = 'true';

	$c['recheck_reason'] = $recheck_reason;



    $query_string = '';

    foreach ( $c as $key => $data )

    $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';



    $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);

    return $response[1];

}

419

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: