WC_API_Customers::register_routes()
Register the routes for this class
GET /customers GET /customers/count GET /customers/<id> GET /customers/<id>/orders
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. |
WC_API_Customers::register_routes() WC API Customers::register routes code WC 7.7.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; }