On this page
get_default_feed(): string
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
File: wp-includes/feed.php. View all references
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.
Related
Uses
| Uses | Description |
|---|---|
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
Used By
| Used By | Description |
|---|---|
| feed_links() wp-includes/general-template.php | Displays the links to the general feeds. |
| WP::send_headers() wp-includes/class-wp.php | Sends additional HTTP headers for caching, content type, etc. |
| WP_Query::is_feed() wp-includes/class-wp-query.php | Is the query for a feed? |
| do_feed() wp-includes/functions.php | Loads the feed template from the use of an action hook. |
| get_search_comments_feed_link() wp-includes/link-template.php | Retrieves the permalink for the search results comments feed. |
| get_post_type_archive_feed_link() wp-includes/link-template.php | Retrieves the permalink for a post type archive feed. |
| get_term_feed_link() wp-includes/link-template.php | Retrieves the feed link for a term. |
| get_search_feed_link() wp-includes/link-template.php | Retrieves the permalink for the search results feed. |
| get_feed_link() wp-includes/link-template.php | Retrieves the permalink for the feed type. |
| get_post_comments_feed_link() wp-includes/link-template.php | Retrieves the permalink for the post comments feed. |
| get_author_feed_link() wp-includes/link-template.php | Retrieves the feed link for a given author. |
| get_the_category_rss() wp-includes/feed.php | Retrieves all of the post categories, formatted for use in feeds. |
| feed_content_type() wp-includes/feed.php | Returns the content type for specified feed type. |
| get_the_content_feed() wp-includes/feed.php | Retrieves the post content for feeds. |
| redirect_canonical() wp-includes/canonical.php | Redirects incoming links to the proper URL based on the site url. |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_default_feed