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

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

原创文章,作者:,如若转载,请注明出处:https://ce.771633.xyz/2216.html

Like (0)
Previous 2025年3月8日
Next 2025年3月8日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注