the_feed_link() WordPress Function

The the_feed_link() function outputs a link to the RSS feed for the current post in the WordPress loop.

the_feed_link( string $anchor, string $feed = '' ) #

Displays the permalink for the feed type.


Parameters

$anchor

(string)(Required)The link's anchor text.

$feed

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

Default value: ''


Top ↑

Source

File: wp-includes/link-template.php

function the_feed_link( $anchor, $feed = '' ) {
	$link = '<a href="' . esc_url( get_feed_link( $feed ) ) . '">' . $anchor . '</a>';

	/**
	 * Filters the feed link anchor tag.
	 *
	 * @since 3.0.0
	 *
	 * @param string $link The complete anchor tag for a feed link.
	 * @param string $feed The feed type. Possible values include 'rss2', 'atom',
	 *                     or an empty string for the default feed type.
	 */
	echo apply_filters( 'the_feed_link', $link, $feed );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.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