get_default_feed(): string

In this article

Retrieves the default feed.

Description

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

Return

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

Source

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;
}

Hooks

apply_filters( ‘default_feed’, string $feed_type )

Filters the default feed type.

Changelog

VersionDescription
2.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.