`wp post list`: Add JSON input support for `date_query` argument by sabithahmd · Pull Request #520 · wp-cli/entity-command · GitHub
Skip to content

wp post list: Add JSON input support for date_query argument#520

Merged
swissspidy merged 2 commits into
wp-cli:mainfrom
sabithahmd:fix/519-fix-date-query-not-working-in-post-list
Feb 18, 2025
Merged

wp post list: Add JSON input support for date_query argument#520
swissspidy merged 2 commits into
wp-cli:mainfrom
sabithahmd:fix/519-fix-date-query-not-working-in-post-list

Conversation

@sabithahmd

Copy link
Copy Markdown

Added Utils\parse_shell_arrays for list in post command which will convert argument values from json to array before passing to the query. currently only date_query is added to the list of arguments to be considered for the conversion.
It can be used as wp post list --date_query='{"before":{"year":"2025"}}'
this fixes #519

Thank you @swissspidy for suggesting this solution.

@sabithahmd sabithahmd requested a review from a team as a code owner February 17, 2025 13:50
@swissspidy

Copy link
Copy Markdown
Member

@swissspidy swissspidy added the command:post-list Related to 'post list' command label Feb 18, 2025
@swissspidy swissspidy changed the title fixed date_query argument not working for post list command wp post list: Add JSON input support for date_query argument Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:post-list Related to 'post list' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support WP_Query's date_query values from wp post list command-line

3 participants