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

文 / @WordPress主题

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()
添加UTHEME为好友
扫码添加UTHEME微信为好友
· 分享WordPress相关技术文章,主题上新与优惠动态早知道。
· 微信端最大WordPress社群,限时免费入群。