WordPress at a glance
function is not described

WC_API_Reports::register_routes() public WC 2.1

Register the routes for this class

GET /reports GET /reports/sales

{} It's a method of the class: WC_API_Reports{}

No Hooks.

Return

Array.

Usage

$WC_API_Reports = new WC_API_Reports();
$WC_API_Reports->register_routes( $routes );
$routes(array) (required)
-

Changelog

Since 2.1 Introduced.

Code of WC_API_Reports::register_routes() WC 5.0.0

<?php
public function register_routes( $routes ) {

	# GET /reports
	$routes[ $this->base ] = array(
		array( array( $this, 'get_reports' ),     WC_API_Server::READABLE ),
	);

	# GET /reports/sales
	$routes[ $this->base . '/sales' ] = array(
		array( array( $this, 'get_sales_report' ), WC_API_Server::READABLE ),
	);

	# GET /reports/sales/top_sellers
	$routes[ $this->base . '/sales/top_sellers' ] = array(
		array( array( $this, 'get_top_sellers_report' ), WC_API_Server::READABLE ),
	);

	return $routes;
}