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
See also
Parameters
- $tag
(int|object)(Required)Tag ID or object.
Return
(string) Link on success, empty string if tag does not exist.
Source
File: wp-includes/category-template.php
function get_tag_link( $tag ) { return get_category_link( $tag ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |