wp_create_tag

The timeline below displays how wordpress function wp_create_tag has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Adds a new tag to the database if it does not already exist.
 *
 * @since 2.3.0
 *
 * @param int|string $tag_name
 * @return array|WP_Error
 */
function wp_create_tag($tag_name)
{
    return wp_create_term($tag_name, 'post_tag');
}

WordPress Version: 4.2

/**
 * Add a new tag to the database if it does not already exist.
 *
 * @since 2.3.0
 *
 * @param int|string $tag_name
 * @return array|WP_Error
 */
function wp_create_tag($tag_name)
{
    return wp_create_term($tag_name, 'post_tag');
}

WordPress Version: 4.1

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.3.0
 *
 * @param int|string $tag_name
 * @return array|WP_Error
 */
function wp_create_tag($tag_name)
{
    return wp_create_term($tag_name, 'post_tag');
}

WordPress Version: 3.7

/**
 * {@internal Missing Short Description}}
 *
 * @since 2.3.0
 *
 * @param unknown_type $tag_name
 * @return unknown
 */
function wp_create_tag($tag_name)
{
    return wp_create_term($tag_name, 'post_tag');
}