Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: akismet_request_args

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

This hook occurs 3 times in this file.

Line Code
863
864      public static function get_akismet_user( $api_key ) {
865           $akismet_user = false;
866
867           $request_args = array(
868                'key' => $api_key,
869                'blog' => get_option( 'home' ),
870           );
871
872           $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-subscription' );
873
874           $subscription_verification = Akismet::http_post( Akismet::build_query( $request_args ), 'get-subscription' );
875
876           if ( ! empty( $subscription_verification[1] ) ) {
877                if ( 'invalid' !== $subscription_verification[1] ) {
878                     $akismet_user = json_decode( $subscription_verification[1] );
879                }
880           }
881
 
Line Code
886           $stat_totals = array();
887
888           foreach( array( '6-months', 'all' ) as $interval ) {
889                $request_args = array(
890                     'blog' => get_option( 'home' ),
891                     'key' => $api_key,
892                     'from' => $interval,
893                );
894
895                $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-stats' );
896
897                $response = Akismet::http_post( Akismet::build_query( $request_args ), 'get-stats' );
898
899                if ( ! empty( $response[1] ) ) {
900                     $stat_totals[$interval] = json_decode( $response[1] );
901                }
902           }
903
904           return $stat_totals;
 
Line Code
908           $request_args = array_merge(
909                array(
910                     'user_id' => $user_id,
911                     'api_key' => $api_key,
912                     'get_account_type' => 'true',
913                ),
914                $extra
915           );
916
917           $request_args = apply_filters( 'akismet_request_args', $request_args, 'verify-wpcom-key' );
918
919           $akismet_account = Akismet::http_post( Akismet::build_query( $request_args ), 'verify-wpcom-key' );
920
921           if ( ! empty( $akismet_account[1] ) )
922                $akismet_account = json_decode( $akismet_account[1] );
923
924           Akismet::log( compact( 'akismet_account' ) );
925
926           return $akismet_account;