Merge pull request #29909 from woocommerce/fix/28132

REST API: Update date_query usage in CRUD controller to be consistent and generate an array of queries
This commit is contained in:
Christopher Allford 2021-05-14 12:58:20 -07:00 committed by GitHub
commit bdef58fe44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -303,7 +303,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
// Check flag to use post_date vs post_date_gmt.
if ( true === $request['dates_are_gmt'] ) {
if ( isset( $request['before'] ) || isset( $request['after'] ) ) {
$args['date_query']['column'] = 'post_date_gmt';
$args['date_query'][0]['column'] = 'post_date_gmt';
}
}