wpseek.com
A WordPress-centric search engine for devs and theme authors



tag_exists › WordPress Function

Since2.3.0
Deprecatedn/a
tag_exists ( $tag_name )
Parameters:
  • (int|string) $tag_name
    Required: Yes
Returns:
  • (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.
Defined at:
Codex:

Checks whether a post tag with a given name exists.



Source

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