Skip to content

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

Closed

Description

@drzraf

Feature Request

Describe your use case and the problem you are facing

wp post list support arbitrary --<field> being passed to WP_Query but date parameters which depends on a nested structure are not handled. Doing so would allow handy filtering logic based on post date attributes.

Describe the solution you'd like

--date-<field> could be used as a prefix opening the way to things like --date-before=2024-01-01 or --date-year=2025
(The same applied to meta_query would also be great as it would resolves the long-standing problem of retrieving posts based on meta-condition straight from wp post list without any piping/subcommand)

Activity

  1. added
    command:post-list
    on Feb 2, 2025
  2. swissspidy commented on Feb 2, 2025

    @swissspidy
    Member

    Thanks for the suggestion!

    Perhaps we could support JSON input for these cases.

  3. swissspidy commented on Feb 7, 2025

    @swissspidy
    Member
  4. drzraf commented on Feb 20, 2025

    @drzraf
    Author

    Could you please add tax_query to this $array_arguments variable. I tested, it works well!

  5. swissspidy commented on Feb 20, 2025

    @swissspidy
    Member

    Are you perhaps up for submitting a PR? :-)

  6. drzraf commented on Feb 20, 2025

    @drzraf
    Author

    Yes... but... I fear... you may legitimately ask for behat tests and their

    When I run wp term create post_tag foo
    and when I run wp post create --tax_input=stuff
    and 🙄⏳🫣⏳🤯

  7. swissspidy commented on Feb 21, 2025

    @swissspidy
    Member

    See, it basically writes itself :-)

    But here you go: #522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    command:post-listgood-first-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions