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
127           if ( isset( $response[0]['x-akismet-pro-tip'] ) )
128              $commentdata['akismet_pro_tip'] = $response[0]['x-akismet-pro-tip'];
129
130           if ( 'true' == $response[1] ) {
131                // akismet_spam_count will be incremented later by comment_is_spam()
132                self::$last_comment_result = 'spam';
133
134                $discard = ( isset( $commentdata['akismet_pro_tip'] ) && $commentdata['akismet_pro_tip'] === 'discard' && self::allow_discard() );
135
136                do_action( 'akismet_spam_caught', $discard );
137
138                if ( $discard ) {
139                     // akismet_result_spam() won't be called so bump the counter here
140                     if ( $incr = apply_filters('akismet_spam_count_incr', 1) )
141                          update_option( 'akismet_spam_count', get_option('akismet_spam_count') + $incr );
142                     $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : get_permalink( $post );
143                     wp_safe_redirect( esc_url_raw( $redirect_to ) );
144                     die();
145                }