WordPress at Your Fingertips
function is not described

WC_API_Customers::register_routes() public WC 2.1

Register the routes for this class

GET /customers GET /customers/count GET /customers/<id> GET /customers/<id>/orders

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

No Hooks.

Return

Array.

Usage

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

Changelog

Since 2.1 Introduced.

Code of WC_API_Customers::register_routes() WC 5.6.0

public function register_routes( $routes ) {

	# GET /customers
	$routes[ $this->base ] = array(
		array( array( $this, 'get_customers' ),     WC_API_SERVER::READABLE ),
	);

	# GET /customers/count
	$routes[ $this->base . '/count' ] = array(
		array( array( $this, 'get_customers_count' ), WC_API_SERVER::READABLE ),
	);

	# GET /customers/<id>
	$routes[ $this->base . '/(?P<id>\d+)' ] = array(
		array( array( $this, 'get_customer' ),  WC_API_SERVER::READABLE ),
	);

	# GET /customers/<id>/orders
	$routes[ $this->base . '/(?P<id>\d+)/orders' ] = array(
		array( array( $this, 'get_customer_orders' ), WC_API_SERVER::READABLE ),
	);

	return $routes;
}