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
256      $query_string = '';
257      foreach ( $comment as $key => $data )
258           $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&';
259
260      $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port);
261      if ( 'true' == $response[1] ) {
262           add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';'));
263           update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 );
264
265           do_action( 'akismet_spam_caught' );
266
267           $post = get_post( $comment['comment_post_ID'] );
268           $last_updated = strtotime( $post->post_modified_gmt );
269           $diff = time() - $last_updated;
270           $diff = $diff / 86400;
271
272           if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' )
273                die;
274      }