get_default_feed() WordPress Function

The get_default_feed() function in WordPress returns the default feed url.

get_default_feed() #

Retrieve the default feed.


Description

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


Top ↑

Return

(string) Default feed, or for example 'rss2', 'atom', etc.


Top ↑

Source

File: wp-includes/feed.php

function get_default_feed() {
	/**
	 * Filters the default feed type.
	 *
	 * @since 2.5.0
	 *
	 * @param string $feed_type Type of default feed. Possible values include 'rss2', 'atom'.
	 *                          Default 'rss2'.
	 */
	$default_feed = apply_filters( 'default_feed', 'rss2' );

	return ( 'rss' === $default_feed ) ? 'rss2' : $default_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.