wp_create_tag() – Add a new tag to the database if it does not already exist.

You appear to be a bot. Output may be restricted

Description

Add a new tag to the database if it does not already exist.

Usage

$array|WP_Error = wp_create_tag( $tag_name );

Parameters

$tag_name
( int|string ) required

Returns

array|WP_Error

Source

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

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

 View on GitHub View on Trac