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



tag_exists › WordPress Function

Since2.3.0
已弃用n/a
tag_exists ( $tag_name )
参数:
  • (int|string) $tag_name
    Required: Yes
返回:
  • (mixed) Returns null if the term does not exist. Returns an array of the term ID and the term taxonomy ID if the pairing exists. Returns 0 if term ID 0 is passed to the function.
定义在:
文档:

Checks whether a post tag with a given name exists.



源码

function tag_exists( $tag_name ) {
	return term_exists( $tag_name, 'post_tag' );
}