tag_exists() – Check whether a post tag with a given name exists.

You appear to be a bot. Output may be restricted

Description

Check whether a post tag with a given name exists.

Usage

$mixed = tag_exists( $tag_name );

Parameters

$tag_name
( int|string ) required

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.

Source

File name: wordpress/wp-admin/includes/taxonomy.php
Lines:

1 to 3 of 3
function tag_exists( $tag_name ) {
  return term_exists( $tag_name, 'post_tag' );
}
 

 View on GitHub View on Trac