From 4a8db96c916266c964ccaf15fe5070a24782cd22 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 8 Aug 2016 12:10:29 +0100 Subject: [PATCH] [2.6][api] ID needs to be capitalized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sorting won’t work with lowercase id Fixes #11635 @claudiosmweb --- includes/abstracts/abstract-wc-rest-posts-controller.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/abstracts/abstract-wc-rest-posts-controller.php b/includes/abstracts/abstract-wc-rest-posts-controller.php index 6b634c0bf49..bea36577bcf 100644 --- a/includes/abstracts/abstract-wc-rest-posts-controller.php +++ b/includes/abstracts/abstract-wc-rest-posts-controller.php @@ -521,6 +521,8 @@ abstract class WC_REST_Posts_Controller extends WC_REST_Controller { if ( 'include' === $query_args['orderby'] ) { $query_args['orderby'] = 'post__in'; + } elseif ( 'id' === $query_args['orderby'] ) { + $query_args['orderby'] = 'ID'; // ID must be capitalized } return $query_args;