WordPress函数is_taxonomy_hierarchical用来检查分类法是否支持层级
is_taxonomy_hierarchical( string $taxonomy )
函数参数
$taxonomy
字符串
分类法名称或对象
函数使用示例
if(!is_taxonomy_hierarchical('tag')) { echo '标签不支持层级'; }
扩展阅读
is_taxonomy_hierarchical()函数位于:wp-includes/taxonomy.php
相关函数:
- taxonomy_exists()
- get_taxonomy()