tag_exists( int|string $tag_name )

Checks whether a post tag with a given name exists.


Parameters

$tag_name

(Required)


Return

(mixed) Returns null if the term does not exist.<br> Returns an array of the term ID and the term taxonomy ID if the pairing exists.<br> Returns 0 if term ID 0 is passed to the function.


Source

File: wp-admin/includes/taxonomy.php

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


Changelog

Changelog
Version Description
2.3.0 Introduced.