Checks whether a post tag with a given name exists.
Parameters
$tag_name
int|stringrequired
Source
function tag_exists( $tag_name ) {
return term_exists( $tag_name, 'post_tag' );
}
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
Checks whether a post tag with a given name exists.
$tag_name
int|stringrequiredfunction tag_exists( $tag_name ) {
return term_exists( $tag_name, 'post_tag' );
}
Version | Description |
---|---|
2.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.