Definition:
function akismet_submit_nonspam_comment ( $comment_id ) {}
Parameters
- $comment_id
Defined actions
- akismet_submit_nonspam_comment
do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
Source code
function akismet_submit_nonspam_comment ( $comment_id ) {
global $wpdb, $akismet_api_host, $akismet_api_port, $current_user, $current_site;
$comment_id = (int) $comment_id;
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID = '$comment_id'");
if ( !$comment ) // it was deleted
return;
$comment->blog = get_option('home');
$comment->blog_lang = get_locale();
$comment->blog_charset = get_option('blog_charset');
$comment->permalink = get_permalink($comment->comment_post_ID);
if ( is_object($current_user) ) {
$comment->reporter = $current_user->user_login;
}
if ( is_object($current_site) ) {
$comment->site_domain = $current_site->domain;
}
$comment->user_role = '';
if ( isset( $comment->user_ID ) )
$comment->user_role = akismet_get_user_roles($comment->user_ID);
$query_string = '';
foreach ( $comment as $key => $data )
$query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
$response = akismet_http_post($query_string, $akismet_api_host, "/1.1/submit-ham", $akismet_api_port);
do_action('akismet_submit_nonspam_comment', $comment_id, $response[1]);
}
513

February 11, 2011 


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