Skip to content

Commit 76114c9

Browse files
committed
fixed date_query argument not working for post list command
1 parent 6eaa622 commit 76114c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Post_Command.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,14 @@ protected function delete_callback( $post_id, $assoc_args ) {
632632
public function list_( $args, $assoc_args ) {
633633
$formatter = $this->get_formatter( $assoc_args );
634634

635-
$defaults = [
635+
$defaults = [
636636
'posts_per_page' => -1,
637637
'post_status' => 'any',
638638
];
639-
$query_args = array_merge( $defaults, $assoc_args );
640-
$query_args = self::process_csv_arguments_to_arrays( $query_args );
639+
$array_arguments = [ 'date_query' ];
640+
$assoc_args = Utils\parse_shell_arrays( $assoc_args, $array_arguments );
641+
$query_args = array_merge( $defaults, $assoc_args );
642+
$query_args = self::process_csv_arguments_to_arrays( $query_args );
641643
if ( isset( $query_args['post_type'] ) && 'any' !== $query_args['post_type'] ) {
642644
$query_args['post_type'] = explode( ',', $query_args['post_type'] );
643645
}

0 commit comments

Comments
 (0)