WP-CLI 命令行手册

title: "wp taxonomy" post_status: publish comment_status: open taxonomy: category: - wp-cli-handbook post_tag: - Commands - Repos - Data


wp taxonomy

检索已注册分类法的相关信息。

请参考内置分类法自定义分类法的文档。

示例

# 列出所有对象类型为 'post' 的分类法。
$ wp taxonomy list --object_type=post --fields=name,public
+-------------+--------+
| name        | public |
+-------------+--------+
| category    | 1      |
| post_tag    | 1      |
| post_format | 1      |
+-------------+--------+

# 获取 'post_tag' 分类法的权限信息。
$ wp taxonomy get post_tag --field=cap
{"manage_terms":"manage_categories","edit_terms":"manage_categories","delete_terms":"manage_categories","assign_terms":"edit_posts"}