You appear to be a bot. Output may be restricted
Description
Get the Akismet stats for a given time period.
Possible interval
values:
- all
- 60-days
- 6-months
Usage
$WP_Error|WP_REST_Response = Akismet_REST_API::get_stats( $request );
Parameters
- $request
- ( WP_REST_Request ) required –
Returns
WP_Error|WP_REST_Response
Source
File name: akismet/class.akismet-rest-api.php
Lines:
1 to 15 of 15
public static function get_stats( $request ) { $api_key = Akismet::get_api_key(); $interval = $request->get_param( 'interval' ); $stat_totals = array(); $response = Akismet::http_post( Akismet::build_query( array( 'blog' => get_option( 'home' ), 'key' => $api_key, 'from' => $interval ) ), 'get-stats' ); if ( ! empty( $response[1] ) ) { $stat_totals[$interval] = json_decode( $response[1] ); } return rest_ensure_response( $stat_totals ); }