Allow reordering of the order list with the REST api

This commit is contained in:
sparkweb 2014-03-12 23:47:42 -06:00
parent c27a5a3f4d
commit 25900f9976
1 changed files with 6 additions and 0 deletions

View File

@ -374,6 +374,12 @@ class WC_API_Orders extends WC_API_Resource {
unset( $args['status'] );
}
// allow order change (ASC or DESC)
if ( ! empty( $args['order'] ) ) {
$query_args['order'] = $args['order'];
unset( $args['order'] );
}
$query_args = $this->merge_query_args( $query_args, $args );
return new WP_Query( $query_args );