Plugin Updates
This commit is contained in:
@@ -59,22 +59,22 @@ class WC_API_Customers extends WC_API_Resource {
|
||||
|
||||
# GET /customers
|
||||
$routes[ $this->base ] = array(
|
||||
array( array( $this, 'get_customers' ), WC_API_SERVER::READABLE ),
|
||||
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 ),
|
||||
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 ),
|
||||
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 ),
|
||||
array( array( $this, 'get_customer_orders' ), WC_API_Server::READABLE ),
|
||||
);
|
||||
|
||||
return $routes;
|
||||
|
||||
@@ -278,7 +278,7 @@ class WC_API_Server {
|
||||
|
||||
// Normalise the endpoints
|
||||
foreach ( $endpoints as $route => &$handlers ) {
|
||||
if ( count( $handlers ) <= 2 && isset( $handlers[1] ) && ! is_array( $handlers[1] ) ) {
|
||||
if ( is_array( $handlers ) && count( $handlers ) <= 2 && isset( $handlers[1] ) && ! is_array( $handlers[1] ) ) {
|
||||
$handlers = array( $handlers );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user