用于生成指定数量的新评论,并填充虚拟数据。
适合在测试或开发环境中快速创建评论数据,支持指定所属文章和输出格式。
| 参数 | 说明 |
|---|---|
--count=<number> | 要生成的评论数量。默认:100 |
--post_id=<post-id> | 将评论分配给特定文章。 |
--format=<format> | 以特定格式渲染输出。默认:progress;选项:progress、ids |
$ wp comment generate --format=ids --count=3 --post_id=123
138 139 140
$ wp comment generate --format=ids --count=3 | xargs -d ' ' -I % wp comment meta add % foo bar
Success: Added custom field.
Success: Added custom field.
Success: Added custom field.