WordPress检查分类法是否支持层级函数:is_taxonomy_hierarchical

作者: 站长 上传时间: 浏览: N/A 下载: N/A 格式: N/A 评分: N/A

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()