[REST API] Fixed orderby slug

This commit is contained in:
Claudio Sanches 2018-12-06 16:17:58 -02:00
parent 99b633d1e5
commit fb35324c4f
1 changed files with 2 additions and 0 deletions

View File

@ -530,6 +530,8 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller {
$query_args['orderby'] = 'post__in';
} elseif ( 'id' === $query_args['orderby'] ) {
$query_args['orderby'] = 'ID'; // ID must be capitalized.
} elseif ( 'slug' === $query_args['orderby'] ) {
$query_args['orderby'] = 'name';
}
return $query_args;