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
991       * - next_billing_date (int|false): Unix timestamp of next billing date, or false if none.
992       * - limit_reached (bool): Whether the usage limit has been reached.
993       */
994      public static function get_akismet_user( $api_key ) {
995           $request_args = array(
996                'key'  => $api_key,
997                'blog' => get_option( 'home' ),
998           );
999
1000           $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-subscription' );
1001
1002           $subscription_verification = Akismet::http_post( Akismet::build_query( $request_args ), 'get-subscription' );
1003
1004           $akismet_user = false;
1005
1006           if ( ! empty( $subscription_verification[1] ) ) {
1007                if ( 'invalid' !== $subscription_verification[1] ) {
1008                     $decoded = json_decode( $subscription_verification[1] );
1009                     if ( is_object( $decoded ) ) {
 
Line Code
1019           $stat_totals = array();
1020
1021           foreach ( array( '6-months', 'all' ) as $interval ) {
1022                $request_args = array(
1023                     'blog' => get_option( 'home' ),
1024                     'key'  => $api_key,
1025                     'from' => $interval,
1026                );
1027
1028                $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-stats' );
1029
1030                $response = Akismet::http_post( Akismet::build_query( $request_args ), 'get-stats' );
1031
1032                if ( ! empty( $response[1] ) ) {
1033                     $data = json_decode( $response[1] );
1034                     /*
1035                      * The json decoded response should be an object. If it's not an object, something's wrong, and the data
1036                      * shouldn't be added to the stats_totals array.
1037                      */
 
Line Code
1048           $request_args = array_merge(
1049                array(
1050                     'user_id'          => $user_id,
1051                     'api_key'          => $api_key,
1052                     'get_account_type' => 'true',
1053                ),
1054                $extra
1055           );
1056
1057           $request_args = apply_filters( 'akismet_request_args', $request_args, 'verify-wpcom-key' );
1058
1059           $akismet_account = Akismet::http_post( Akismet::build_query( $request_args ), 'verify-wpcom-key' );
1060
1061           if ( ! empty( $akismet_account[1] ) ) {
1062                $akismet_account = json_decode( $akismet_account[1] );
1063           }
1064
1065           Akismet::log( compact( 'akismet_account' ) );
1066