Added the 'after_gmt' and 'before_gm' parameters
This commit is contained in:
parent
0d59195657
commit
98af7209da
|
@ -300,6 +300,18 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
$args['date_query'][0]['after'] = $request['after'];
|
||||
}
|
||||
|
||||
// Set before_gmt into date query. Date query must be specified as an array of an array.
|
||||
if ( isset( $request['before_gmt'] ) ) {
|
||||
$args['date_query'][0]['before'] = $request['before_gmt'];
|
||||
$args['date_query']['column'] = 'post_date_gmt';
|
||||
}
|
||||
|
||||
// Set after_gmt into date query. Date query must be specified as an array of an array.
|
||||
if ( isset( $request['after_gmt'] ) ) {
|
||||
$args['date_query'][0]['after'] = $request['after_gmt'];
|
||||
$args['date_query']['column'] = 'post_date_gmt';
|
||||
}
|
||||
|
||||
// Force the post_type argument, since it's not a user input variable.
|
||||
$args['post_type'] = $this->post_type;
|
||||
|
||||
|
|
Loading…
Reference in New Issue