get_the_content_feed() WordPress Function

The get_the_content_feed() function retrieves the content of a post and formats it for display in a feed.

get_the_content_feed( string $feed_type = null ) #

Retrieve the post content for feeds.


Description

Top ↑

See also


Top ↑

Parameters

$feed_type

(string)(Optional)The type of feed. rss2 | atom | rss | rdf

Default value: null


Top ↑

Return

(string) The filtered content.


Top ↑

Source

File: wp-includes/feed.php

function get_the_content_feed( $feed_type = null ) {
	if ( ! $feed_type ) {
		$feed_type = get_default_feed();
	}

	/** This filter is documented in wp-includes/post-template.php */
	$content = apply_filters( 'the_content', get_the_content() );
	$content = str_replace( ']]>', ']]>', $content );

	/**
	 * Filters the post content for use in feeds.
	 *
	 * @since 2.9.0
	 *
	 * @param string $content   The current post content.
	 * @param string $feed_type Type of feed. Possible values include 'rss2', 'atom'.
	 *                          Default 'rss2'.
	 */
	return apply_filters( 'the_content_feed', $content, $feed_type );
}


Top ↑

Changelog

Changelog
VersionDescription
2.9.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.