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.
This hook occurs 2 times in this file.
Line | Code |
---|---|
324 | $comment['blog'] = get_option('home'); |
325 | $comment['blog_lang'] = get_locale(); |
326 | $comment['blog_charset'] = get_option('blog_charset'); |
327 | $comment['permalink'] = get_permalink($comment['comment_post_ID']); |
328 | |
329 | if ( !empty( $comment['user_ID'] ) ) { |
330 | $comment['user_role'] = akismet_get_user_roles($comment['user_ID']); |
331 | } |
332 |
|
333 | $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) ); |
334 | $comment['akismet_comment_nonce'] = 'inactive'; |
335 | if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) { |
336 | $comment['akismet_comment_nonce'] = 'failed'; |
337 | if ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) ) |
338 | $comment['akismet_comment_nonce'] = 'passed'; |
339 |
|
340 | // comment reply in wp-admin |
341 | if ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) ) |
342 | $comment['akismet_comment_nonce'] = 'passed'; |
Line | Code |
572 | } |
573 | add_action( 'akismet_schedule_cron_recheck', 'akismet_cron_recheck' ); |
574 |
|
575 | function akismet_add_comment_nonce( $post_id ) { |
576 | echo '<p style="display: none;">'; |
577 | wp_nonce_field( 'akismet_comment_nonce_' . $post_id, 'akismet_comment_nonce', FALSE ); |
578 | echo '</p>'; |
579 | } |
580 |
|
581 | $akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) ); |
582 |
|
583 | if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' ) |
584 | add_action( 'comment_form', 'akismet_add_comment_nonce' ); |
585 |
|
586 | global $wp_version; |
587 | if ( '3.0.5' == $wp_version ) { |
588 | remove_filter( 'comment_text', 'wp_kses_data' ); |
589 | if ( is_admin() ) |
590 | add_filter( 'comment_text', 'wp_kses_post' ); |