get_tag_link

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

WordPress Version: 5.5

//
// Tags.
//
/**
 * Retrieves the link to the tag.
 *
 * @since 2.3.0
 *
 * @see get_term_link()
 *
 * @param int|object $tag Tag ID or object.
 * @return string Link on success, empty string if tag does not exist.
 */
function get_tag_link($tag)
{
    return get_category_link($tag);
}

WordPress Version: 5.4

//
// Tags.
//
/**
 * Retrieve the link to the tag.
 *
 * @since 2.3.0
 * @see get_term_link()
 *
 * @param int|object $tag Tag ID or object.
 * @return string Link on success, empty string if tag does not exist.
 */
function get_tag_link($tag)
{
    return get_category_link($tag);
}

WordPress Version: .10

//
// Tags
//
/**
 * Retrieve the link to the tag.
 *
 * @since 2.3.0
 * @see get_term_link()
 *
 * @param int|object $tag Tag ID or object.
 * @return string Link on success, empty string if tag does not exist.
 */
function get_tag_link($tag)
{
    return get_category_link($tag);
}

WordPress Version: 3.7

//
// Tags
//
/**
 * Retrieve the link to the tag.
 *
 * @since 2.3.0
 * @see get_term_link()
 *
 * @param int|object $tag Tag ID or object.
 * @return string Link on success, empty string if tag does not exist.
 */
function get_tag_link($tag)
{
    if (!is_object($tag)) {
        $tag = (int) $tag;
    }
    $tag = get_term_link($tag, 'post_tag');
    if (is_wp_error($tag)) {
        return '';
    }
    return $tag;
}