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 3 times in this file.
| Line | Code |
|---|---|
| 967 | |
| 968 | public static function get_akismet_user( $api_key ) { |
| 969 | $akismet_user = false; |
| 970 | |
| 971 | $request_args = array( |
| 972 | 'key' => $api_key, |
| 973 | 'blog' => get_option( 'home' ), |
| 974 | ); |
| 975 | |
| 976 | $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-subscription' ); |
| 977 | |
| 978 | $subscription_verification = Akismet::http_post( Akismet::build_query( $request_args ), 'get-subscription' ); |
| 979 | |
| 980 | if ( ! empty( $subscription_verification[1] ) ) { |
| 981 | if ( 'invalid' !== $subscription_verification[1] ) { |
| 982 | $akismet_user = json_decode( $subscription_verification[1] ); |
| 983 | } |
| 984 | } |
| 985 | |
| Line | Code |
| 990 | $stat_totals = array(); |
| 991 | |
| 992 | foreach ( array( '6-months', 'all' ) as $interval ) { |
| 993 | $request_args = array( |
| 994 | 'blog' => get_option( 'home' ), |
| 995 | 'key' => $api_key, |
| 996 | 'from' => $interval, |
| 997 | ); |
| 998 | |
| 999 | $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-stats' ); |
| 1000 | |
| 1001 | $response = Akismet::http_post( Akismet::build_query( $request_args ), 'get-stats' ); |
| 1002 | |
| 1003 | if ( ! empty( $response[1] ) ) { |
| 1004 | $data = json_decode( $response[1] ); |
| 1005 | /* |
| 1006 | * The json decoded response should be an object. If it's not an object, something's wrong, and the data |
| 1007 | * shouldn't be added to the stats_totals array. |
| 1008 | */ |
| Line | Code |
| 1019 | $request_args = array_merge( |
| 1020 | array( |
| 1021 | 'user_id' => $user_id, |
| 1022 | 'api_key' => $api_key, |
| 1023 | 'get_account_type' => 'true', |
| 1024 | ), |
| 1025 | $extra |
| 1026 | ); |
| 1027 | |
| 1028 | $request_args = apply_filters( 'akismet_request_args', $request_args, 'verify-wpcom-key' ); |
| 1029 | |
| 1030 | $akismet_account = Akismet::http_post( Akismet::build_query( $request_args ), 'verify-wpcom-key' ); |
| 1031 | |
| 1032 | if ( ! empty( $akismet_account[1] ) ) { |
| 1033 | $akismet_account = json_decode( $akismet_account[1] ); |
| 1034 | } |
| 1035 | |
| 1036 | Akismet::log( compact( 'akismet_account' ) ); |
| 1037 | |