Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed date_query argument not working for post list command
  • Loading branch information
applab-wp committed Feb 17, 2025
commit 76114c90210613d0ea11e9ff2bbae715c6a164c0
8 changes: 5 additions & 3 deletions src/Post_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,14 @@ protected function delete_callback( $post_id, $assoc_args ) {
public function list_( $args, $assoc_args ) {
$formatter = $this->get_formatter( $assoc_args );

$defaults = [
$defaults = [
'posts_per_page' => -1,
'post_status' => 'any',
];
$query_args = array_merge( $defaults, $assoc_args );
$query_args = self::process_csv_arguments_to_arrays( $query_args );
$array_arguments = [ 'date_query' ];
$assoc_args = Utils\parse_shell_arrays( $assoc_args, $array_arguments );
$query_args = array_merge( $defaults, $assoc_args );
$query_args = self::process_csv_arguments_to_arrays( $query_args );
if ( isset( $query_args['post_type'] ) && 'any' !== $query_args['post_type'] ) {
$query_args['post_type'] = explode( ',', $query_args['post_type'] );
}
Expand Down