Allow using meta_value_num with resource orderby

Part of #5720
This commit is contained in:
Max Rice 2014-07-28 19:49:56 -04:00
parent bb651761d0
commit 47ccd78b21
2 changed files with 2 additions and 2 deletions

View File

@ -549,7 +549,7 @@ class WC_API_Customers extends WC_API_Resource {
$query_args['orderby'] = $args['orderby']; $query_args['orderby'] = $args['orderby'];
// allow sorting by meta value // allow sorting by meta value
if ( 'meta_value' === $query_args['orderby'] && ! empty( $args['orderby_meta_key'] ) ) { if ( ! empty( $args['orderby_meta_key'] ) ) {
$query_args['meta_key'] = $args['orderby_meta_key']; $query_args['meta_key'] = $args['orderby_meta_key'];
} }
} }

View File

@ -168,7 +168,7 @@ class WC_API_Resource {
$args['orderby'] = $request_args['orderby']; $args['orderby'] = $request_args['orderby'];
// allow sorting by meta value // allow sorting by meta value
if ( 'meta_value' === $args['orderby'] && ! empty( $request_args['orderby_meta_key'] ) ) { if ( ! empty( $request_args['orderby_meta_key'] ) ) {
$args['meta_key'] = $request_args['orderby_meta_key']; $args['meta_key'] = $request_args['orderby_meta_key'];
} }
} }