wp post list --post_type=page --post_author=987654321
Returns results from all authors
wp post list --post_type=page --author=987654321
Returns results from the given author
Looks like just a naming convention thing ... ie docs at https://wp-cli.org/commands/post/list/ say the field is supposed to be post_author. --post_author works properly on things like wp post create and wp post update, and obviously the column is post_author too.
Just luck that i stumbled on --author working!
Looks like just a naming convention thing ... ie docs at https://wp-cli.org/commands/post/list/ say the field is supposed to be post_author.
The field that is returned in the Post object is post_author. author is one of the supported WP_Query parameters. The "Options" section to the documentation includes:
[--<field>=<value>]
One or more args to pass to WP_Query.
The fact that there's a slight difference is something we'll be reconciling with the RESTful WP-CLI project https://github.com/danielbachhuber/wp-rest-cli
Ouch, this naming difference took me for a spin for a good minute.
Most helpful comment
Ouch, this naming difference took me for a spin for a good minute.