Very basic question, but I couldn't find an answer.
I am using the WP CLI post get command: /
One of the option is [--field=], but I can't find in the doc the list of allowed values for this field.
What am I missing?
Very basic question, but I couldn't find an answer.
I am using the WP CLI post get command: https://wp-cli/commands/post/get/
One of the option is [--field=], but I can't find in the doc the list of allowed values for this field.
What am I missing?
Share Improve this question edited Dec 19, 2016 at 1:39 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Dec 19, 2016 at 0:30 SulliSulli 1451 silver badge4 bronze badges 1 |2 Answers
Reset to default 2The list of fields is available on the wp post list
page.
These fields will be displayed by default for each post:
ID post_title post_name post_date post_status
These fields are optionally available:
post_author post_date_gmt post_content post_excerpt comment_status ping_status post_password to_ping pinged post_modified post_modified_gmt post_content_filtered post_parent guid menu_order post_type post_mime_type comment_count filter url
Right, I think you have not see example section or the example section is available now.
If you want to display only one field then you can use --field
parameter.
E.g
wp post list --field=ID
And to get multiple fields then you can use --fields
parameter.
E.g.
wp post list --fields=post_title,post_status
--field
is associated argument. Read more about the associate arguments at https://wp.me/p4Ams0-1g1
--fields=
, not --field, and they can be comma separated. – William Turrell Commented Apr 10, 2018 at 15:39