根据WP_Comment_Query()支持的所有参数显示评论列表。
适合在需要查看、筛选或导出WordPress评论时使用,支持按状态、文章ID等条件过滤。
| 参数 | 说明 |
|---|---|
--<field>=<value> |
一个或多个传递给WP_Comment_Query的参数。 |
--field=<field> |
打印每条评论的单个字段值。 |
--fields=<fields> |
将输出限制为特定对象字段。 |
--format=<format> |
以特定格式渲染输出。默认:table。选项:table、ids、csv、json、count、yaml。 |
$ wp comment list --field=ID
$ wp comment list --post_id=1 --fields=ID,comment_date,comment_author
$ wp comment list --number=3 --status=approve --fields=ID,comment_date,comment_author
$ wp comment list --number=3 --status=hold --fields=ID,comment_date,comment_author
$ wp comment list --status=spam --fields=ID,comment_date,comment_author
$ wp comment list --status=trash --fields=ID,comment_date,comment_author