WordPress开发者和主题制作者的搜索引擎



taxonomy_exists ›

Since3.0.0
已弃用n/a
taxonomy_exists ( $taxonomy )
参数:
  • (string) $taxonomy Name of taxonomy object.
    Required: Yes
返回:
  • (bool) Whether the taxonomy exists.
定义在:
文档:

Determines whether the taxonomy name exists.

Formerly is_taxonomy(), introduced in 2.3.0.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.



源码

function taxonomy_exists( $taxonomy ) {
	global $wp_taxonomies;

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