get_default_feed

Retrieve the default feed.

Description

(string) get_default_feed(); 

The default feed is rss2,, unless a plugin changes it through the filter.

Returns (string)

Default feed, or for example 'rss2', 'atom', etc.


Usage

  1. if ( !function_exists( 'get_default_feed' ) ) { 
  2. require_once ABSPATH . WPINC . '/feed.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_default_feed(); 
  7.  

Defined (1)

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

/wp-includes/feed.php  
  1. function get_default_feed() { 
  2. /** 
  3. * Filters the default feed type. 
  4. * @since 2.5.0 
  5. * @param string $feed_type Type of default feed. Possible values include 'rss2', 'atom'. 
  6. * Default 'rss2'. 
  7. */ 
  8. $default_feed = apply_filters( 'default_feed', 'rss2' ); 
  9. return 'rss' == $default_feed ? 'rss2' : $default_feed;