get_tag_link() WordPress Function

The get_tag_link() function in WordPress is used to retrieve the URL of a specified tag. This function can be useful when you want to create a link to a specific tag, or when you need to retrieve the URL for use in another function.

get_tag_link( int|object $tag ) #

Retrieves the link to the tag.


Description

Top ↑

See also


Top ↑

Parameters

$tag

(int|object)(Required)Tag ID or object.


Top ↑

Return

(string) Link on success, empty string if tag does not exist.


Top ↑

Source

File: wp-includes/category-template.php

function get_tag_link( $tag ) {
	return get_category_link( $tag );
}


Top ↑

Changelog

Changelog
VersionDescription
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.