Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: akismet_spam_caught

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
370      $commentdata['comment_as_submitted'] = $comment;
371
372      $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
373      akismet_update_alert( $response );
374      $commentdata['akismet_result'] = $response[1];
375      if ( 'true' == $response[1] ) {
376           // akismet_spam_count will be incremented later by akismet_result_spam()
377           add_filter('pre_comment_approved', 'akismet_result_spam');
378
379           do_action( 'akismet_spam_caught' );
380
381           $last_updated = strtotime( $post->post_modified_gmt );
382           $diff = time() - $last_updated;
383           $diff = $diff / 86400;
384           
385           if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' && empty($comment['user_ID']) ) {
386                // akismet_result_spam() won't be called so bump the counter here
387                if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
388                     update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );