WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
246 | $query_string = ''; |
247 | foreach ( $comment as $key => $data ) |
248 | $query_string .= $key . '=' . urlencode( stripslashes($data) ) . '&'; |
249 |
|
250 | $response = akismet_http_post($query_string, $akismet_api_host, '/1.1/comment-check', $akismet_api_port); |
251 | if ( 'true' == $response[1] ) { |
252 | add_filter('pre_comment_approved', create_function('$a', 'return \'spam\';')); |
253 | update_option( 'akismet_spam_count', get_option('akismet_spam_count') + 1 ); |
254 |
|
255 | do_action( 'akismet_spam_caught' ); |
256 |
|
257 | $post = get_post( $comment['comment_post_ID'] ); |
258 | $last_updated = strtotime( $post->post_modified_gmt ); |
259 | $diff = time() - $last_updated; |
260 | $diff = $diff / 86400; |
261 |
|
262 | if ( $post->post_type == 'post' && $diff > 30 && get_option( 'akismet_discard_month' ) == 'true' ) |
263 | die; |
264 | } |