WC_API_Reports::register_routes()publicWC 2.1

Register the routes for this class

GET /reports GET /reports/sales

{} Это метод класса: WC_API_Reports{}

Хуков нет.

Возвращает

Массив.

Использование

$WC_API_Reports = new WC_API_Reports();
$WC_API_Reports->register_routes( $routes );
$routes(массив) (обязательный)
-

Список изменений

С версии 2.1 Введена.

Код WC_API_Reports::register_routes() WC 6.9.4

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;
}