register_endpoint( '/stats/posts' ); } /** * Cached "proxy" to the Parse.ly `/analytics/posts` API endpoint. * * @param WP_REST_Request $request The request object. * @return stdClass|WP_Error stdClass containing the data or a WP_Error object on failure. */ public function get_items( WP_REST_Request $request ) { return $this->get_data( $request ); } /** * Generates the final data from the passed response. * * @param array $response The response received by the proxy. * @return array The generated data. */ protected function generate_data( $response ): array { return $this->generate_post_data( $response ); } }