get_tag_feed_link() WordPress Function

The get_tag_feed_link() function is used to retrieve the link for the RSS feed associated with a given tag. This function is useful for displaying a link to the feed in the header of a page, or for programmatically retrieving the feed URL for use in an RSS reader.

get_tag_feed_link( int|WP_Term|object $tag, string $feed = '' ) #

Retrieves the permalink for a tag feed.


Parameters

$tag

(int|WP_Term|object)(Required)The ID or term object whose feed link will be retrieved.

$feed

(string)(Optional) Feed type. Possible values include 'rss2', 'atom'. Default is the value of get_default_feed().

Default value: ''


Top ↑

Return

(string) The feed permalink for the given tag.


Top ↑

Source

File: wp-includes/link-template.php

function get_tag_feed_link( $tag, $feed = '' ) {
	return get_term_feed_link( $tag, 'post_tag', $feed );
}


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.

Show More
Show More