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 |
---|---|
31 |
|
32 | /** |
33 | * To disable the Akismet comment nonce, add a filter for the 'akismet_comment_nonce' tag |
34 | * and return any string value that is not 'true' or '' (empty string). |
35 | * |
36 | * Don't return boolean false, because that implies that the 'akismet_comment_nonce' option |
37 | * has not been set and that Akismet should just choose the default behavior for that |
38 | * situation. |
39 | */ |
40 | $akismet_comment_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) ); |
41 |
|
42 | if ( $akismet_comment_nonce_option == 'true' || $akismet_comment_nonce_option == '' ) |
43 | add_action( 'comment_form', array( 'Akismet', 'add_comment_nonce' ), 1 ); |
44 |
|
45 | add_action( 'admin_head-edit-comments.php', array( 'Akismet', 'load_form_js' ) ); |
46 | add_action( 'comment_form', array( 'Akismet', 'load_form_js' ) ); |
47 | add_action( 'comment_form', array( 'Akismet', 'inject_ak_js' ) ); |
48 |
|
49 | add_filter( 'comment_moderation_recipients', array( 'Akismet', 'disable_moderation_emails_if_unreachable' ), 1000, 2 ); |
Line | Code |
127 | $comment['blog'] = get_option('home'); |
128 | $comment['blog_lang'] = get_locale(); |
129 | $comment['blog_charset'] = get_option('blog_charset'); |
130 | $comment['permalink'] = get_permalink( $comment['comment_post_ID'] ); |
131 |
|
132 | if ( !empty( $comment['user_ID'] ) ) |
133 | $comment['user_role'] = Akismet::get_user_roles( $comment['user_ID'] ); |
134 |
|
135 | /** See filter documentation in init_hooks(). */ |
136 | $akismet_nonce_option = apply_filters( 'akismet_comment_nonce', get_option( 'akismet_comment_nonce' ) ); |
137 | $comment['akismet_comment_nonce'] = 'inactive'; |
138 | if ( $akismet_nonce_option == 'true' || $akismet_nonce_option == '' ) { |
139 | $comment['akismet_comment_nonce'] = 'failed'; |
140 | if ( isset( $_POST['akismet_comment_nonce'] ) && wp_verify_nonce( $_POST['akismet_comment_nonce'], 'akismet_comment_nonce_' . $comment['comment_post_ID'] ) ) |
141 | $comment['akismet_comment_nonce'] = 'passed'; |
142 |
|
143 | // comment reply in wp-admin |
144 | if ( isset( $_POST['_ajax_nonce-replyto-comment'] ) && check_ajax_referer( 'replyto-comment', '_ajax_nonce-replyto-comment' ) ) |
145 | $comment['akismet_comment_nonce'] = 'passed'; |