用于管理 WordPress 分类法中的术语(term),支持创建、更新、删除、查询以及重建计数等操作。
适合在需要批量管理分类、标签或自定义分类法时使用。
| 参数 | 说明 |
|---|---|
--description |
术语的描述。 |
--format |
输出格式,如 json。 |
--fields |
要返回的字段列表。 |
--field |
仅返回单个字段的值。 |
--include |
要包含的术语 ID。 |
--name |
术语的新名称。 |
$ wp term create category Apple --description="一种水果"
$ wp term get category 199 --format=json --fields=term_id,name,slug,count
$ wp term update category 15 --name=Apple
$ wp term list post_tag --include=123 --field=url
$ wp term delete category 15
$ wp term recount category post_tag