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 2 times in this file.

Line Code
298
299           $stat_totals = array();
300
301           $request_args = array(
302                'blog' => get_option( 'home' ),
303                'key'  => $api_key,
304                'from' => $interval,
305           );
306
307           $request_args = apply_filters( 'akismet_request_args', $request_args, 'get-stats' );
308
309           $response = Akismet::http_post( Akismet::build_query( $request_args ), 'get-stats' );
310
311           if ( ! empty( $response[1] ) ) {
312                $stat_totals[ $interval ] = json_decode( $response[1] );
313           }
314
315           return rest_ensure_response( $stat_totals );
316      }
 
Line Code
361           return self::get_alert( $request );
362      }
363
364      private static function key_is_valid( $key ) {
365           $request_args = array(
366                'key'  => $key,
367                'blog' => get_option( 'home' ),
368           );
369
370           $request_args = apply_filters( 'akismet_request_args', $request_args, 'verify-key' );
371
372           $response = Akismet::http_post( Akismet::build_query( $request_args ), 'verify-key' );
373
374           if ( $response[1] == 'valid' ) {
375                return true;
376           }
377
378           return false;
379      }