Add order (desc/asc) to REST API customers endpoint

Part of #5720
This commit is contained in:
Max Rice 2014-07-28 19:38:21 -04:00
parent 7f3b67272a
commit 323bcbf848
1 changed files with 4 additions and 0 deletions

View File

@ -539,6 +539,10 @@ class WC_API_Customers extends WC_API_Resource {
$this->created_at_max = $this->server->parse_datetime( $args['created_at_max'] ); $this->created_at_max = $this->server->parse_datetime( $args['created_at_max'] );
} }
// order (ASC or DESC, ASC by default)
if ( ! empty( $args['order'] ) ) {
$query_args['order'] = $args['order'];
}
$query = new WP_User_Query( $query_args ); $query = new WP_User_Query( $query_args );
// helper members for pagination headers // helper members for pagination headers