wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



tag_exists › WordPress Function

Depuis2.3.0
Dépréciéen/a
tag_exists ( $tag_name )
Paramètres:
  • (int|string) $tag_name
    Requis: Oui
Retourne:
  • (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.
Défini(e) dans:
Codex:

Checks whether a post tag with a given name exists.



Source

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