@@ -3150,7 +3150,7 @@ wp post get <id> [--field=<field>] [--fields=<fields>] [--format=<format>]
31503150Gets a list of posts.
31513151
31523152~~~
3153- wp post list [--<field>=<value>] [--field=<field>] [--fields=<fields>] [--format=<format>]
3153+ wp post list [--<field>=<value>] [--p=<id>|ID] [--title=<title>|post_title] [--name=<slug>|post_name] [--author=<author>|post_author] [--author_name=<author_name>] [--post_type=<post_type>] [--post_status=<post_status>] [--post_parent=<post_parent>] [--post_mime_type=<post_mime_type>] [--menu_order=<menu_order>] [--comment_status=<comment_status>] [--ping_status=<ping_status>] [--comment_count=<comment_count>] [--s=<string>] [--year=<year>] [--monthnum=<monthnum>] [--day=<day>] [--m=<yearmonth>] [--w=<week>] [-- field=<field>] [--fields=<fields>] [--format=<format>]
31543154~~~
31553155
31563156Display posts based on all arguments supported by [ WP_Query()] ( https://developer.wordpress.org/reference/classes/wp_query/ ) .
@@ -3159,7 +3159,77 @@ Only shows post types marked as post by default.
31593159** OPTIONS**
31603160
31613161 [--<field>=<value>]
3162- One or more args to pass to WP_Query.
3162+ One or more args to pass to WP_Query. The arguments below are the ones
3163+ that filter on what this command displays; anything else WP_Query accepts
3164+ still works and is documented with WP_Query itself.
3165+
3166+ [--p=<id>|ID]
3167+ Filter by post ID. `--ID` is the name of the column this filters and is
3168+ accepted as an alias.
3169+
3170+ [--title=<title>|post_title]
3171+ Filter by post title, matched in full. `--post_title` is the name of the
3172+ column this filters and is accepted as an alias.
3173+
3174+ [--name=<slug>|post_name]
3175+ Filter by post slug. `--post_name` is the name of the column this filters
3176+ and is accepted as an alias.
3177+ Note: this makes the query a single-post one, and WP_Query returns a draft
3178+ from one of those only to a user who can edit it. WP-CLI runs as no user
3179+ unless the global `--user` argument says otherwise, so pass that to filter
3180+ drafts by slug.
3181+
3182+ [--author=<author>|post_author]
3183+ Filter by the ID of the post's author. `--post_author` is the name of the
3184+ column this filters and is accepted as an alias.
3185+
3186+ [--author_name=<author_name>]
3187+ Filter by the 'user_nicename' of the post's author.
3188+
3189+ [--post_type=<post_type>]
3190+ Filter by post type. Defaults to 'post'. Accepts a comma-separated list,
3191+ or 'any' for every type registered without 'exclude_from_search'.
3192+
3193+ [--post_status=<post_status>]
3194+ Filter by post status. Defaults to 'any', which is every status
3195+ registered without 'exclude_from_search' - so trashed and auto-draft posts
3196+ are left out until asked for by name, e.g. `--post_status=trash`.
3197+
3198+ [--post_parent=<post_parent>]
3199+ Filter by the ID of the parent post.
3200+
3201+ [--post_mime_type=<post_mime_type>]
3202+ Filter by MIME type. Only attachments carry one.
3203+
3204+ [--menu_order=<menu_order>]
3205+ Filter by menu order.
3206+
3207+ [--comment_status=<comment_status>]
3208+ Filter by comment status. Accepts 'open' or 'closed'.
3209+
3210+ [--ping_status=<ping_status>]
3211+ Filter by ping status. Accepts 'open' or 'closed'.
3212+
3213+ [--comment_count=<comment_count>]
3214+ Filter by number of comments.
3215+
3216+ [--s=<string>]
3217+ Only list the posts matching this search term.
3218+
3219+ [--year=<year>]
3220+ Filter by four-digit year, e.g. 2024.
3221+
3222+ [--monthnum=<monthnum>]
3223+ Filter by month number, 1 to 12.
3224+
3225+ [--day=<day>]
3226+ Filter by day of the month, 1 to 31.
3227+
3228+ [--m=<yearmonth>]
3229+ Filter by year and month together, e.g. 202401.
3230+
3231+ [--w=<week>]
3232+ Filter by week of the year, 0 to 53.
31633233
31643234 [--field=<field>]
31653235 Prints the value of a single field for each post.
0 commit comments