最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp cli - WP CLI allowed fields?

programmeradmin4浏览0评论

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
  • Note that you need --fields=, not --field, and they can be comma separated. – William Turrell Commented Apr 10, 2018 at 15:39
Add a comment  | 

2 Answers 2

Reset to default 2

The 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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论