tag_exists

函数
tag_exists ( $tag_name )
参数
  • (int|string) $tag_name
    Required:
返回值
  • (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.
定义位置
相关方法
post_existsterm_existsemail_existsmetadata_existscategory_exists
引入
2.3.0
弃用
-

Checks whether a post tag with a given name exists.

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