diff --git a/includes/api/class-wc-api-customers.php b/includes/api/class-wc-api-customers.php index ba9069d43f2..51f3ca20a4b 100644 --- a/includes/api/class-wc-api-customers.php +++ b/includes/api/class-wc-api-customers.php @@ -549,7 +549,7 @@ class WC_API_Customers extends WC_API_Resource { $query_args['orderby'] = $args['orderby']; // 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']; } } diff --git a/includes/api/class-wc-api-resource.php b/includes/api/class-wc-api-resource.php index ae3a13f95ed..1f2e7215ad0 100644 --- a/includes/api/class-wc-api-resource.php +++ b/includes/api/class-wc-api-resource.php @@ -168,7 +168,7 @@ class WC_API_Resource { $args['orderby'] = $request_args['orderby']; // 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']; } }