get_category_feed_link

Retrieves the feed link for a category.

Description

(string) get_category_feed_link( (int) $cat_id, (string) $feed = '' ); 

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.

Returns (string)

Link to the feed for the category specified by $cat_id.

Parameters (2)

0. $cat_id (int)
Category ID.
1. $feed — Optional. (string) => ''
Feed type. Default empty.

Usage

  1. if ( !function_exists( 'get_category_feed_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/link-template.php'; 
  3.  
  4. // Category ID. 
  5. $cat_id = -1; 
  6.  
  7. // Optional. Feed type. Default empty. 
  8. $feed = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = get_category_feed_link($cat_id, $feed); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/link-template.php  
  1. function get_category_feed_link( $cat_id, $feed = '' ) { 
  2. return get_term_feed_link( $cat_id, 'category', $feed );