get_category_feed_link() WordPress Function

The get_category_feed_link() function retrieves the URL for the feed for a given category.

get_category_feed_link( int|WP_Term|object $cat, string $feed = '' ) #

Retrieves the feed link for a category.


Description

Returns a link to the feed for all posts in a given category. A specific feed can be requested or left blank to get the default feed.


Top ↑

Parameters

$cat

(int|WP_Term|object)(Required)The ID or category 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) Link to the feed for the category specified by $cat.


Top ↑

Source

File: wp-includes/link-template.php

function get_category_feed_link( $cat, $feed = '' ) {
	return get_term_feed_link( $cat, 'category', $feed );
}


Top ↑

Changelog

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