taxonomy_exists

函数
taxonomy_exists ( $taxonomy )
参数
  • (string) $taxonomy Name of taxonomy object.
    Required:
返回值
  • (bool) Whether the taxonomy exists.
定义位置
相关方法
tag_existsterm_existscategory_existsget_taxonomy_labelsdomain_exists
引入
3.0.0
弃用
-

taxonomy_exists: 这个函数检查一个分类法是否存在。

判断分类法名称是否存在。

前身是is_taxonomy(),在2.3.0中引入。

关于这个和类似的主题函数的更多信息,请查看《主题开发者手册》中的{@link Conditional Tags}一文。

function taxonomy_exists( $taxonomy ) {
	global $wp_taxonomies;

	return is_string( $taxonomy ) && isset( $wp_taxonomies[ $taxonomy ] );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 20:33:00

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: