Definition:
function akismet_recheck_queue() {}
Source code
function akismet_recheck_queue() {
global $wpdb, $akismet_api_host, $akismet_api_port;
if ( ! ( isset( $_GET['recheckqueue'] ) || ( isset( $_REQUEST['action'] ) && 'akismet_recheck_queue' == $_REQUEST['action'] ) ) )
return;
$moderation = $wpdb->get_results( "SELECT * FROM $wpdb->comments WHERE comment_approved = '0'", ARRAY_A );
foreach ( (array) $moderation as $c ) {
$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']);
$c['user_role'] = '';
if ( isset( $c['user_ID'] ) )
$c['user_role'] = akismet_get_user_roles($c['user_ID']);
$id = (int) $c['comment_ID'];
$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);
if ( 'true' == $response[1] ) {
if ( function_exists('wp_set_comment_status') )
wp_set_comment_status($id, 'spam');
else
$wpdb->query("UPDATE $wpdb->comments SET comment_approved = 'spam' WHERE comment_ID = $id");
}
}
wp_redirect( $_SERVER['HTTP_REFERER'] );
exit;
}
471

February 11, 2011 


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