Checks whether a post tag with a given name exists.
$tag_nameint|stringrequired
function tag_exists( $tag_name ) {
return term_exists( $tag_name, 'post_tag' );
}
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/tag_exists