tag_exists
Check whether a post tag with a given name exists.
Description
tag_exists( (string) $tag_name );
Parameters (1)
- 0. $tag_name (string)
- The tag name.
Usage
if ( !function_exists( 'tag_exists' ) ) { require_once ABSPATH . '/wp-admin/includes/taxonomy.php'; } // The tag name. $tag_name = ''; // NOTICE! Understand what this does before running. $result = tag_exists($tag_name);
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/taxonomy.php
- function tag_exists($tag_name) {
- return term_exists($tag_name, 'post_tag');
- }