get_the_content_feed

Retrieve the post content for feeds.

Description

(string) get_the_content_feed( (constant) $feed_type = null ); 

Returns (string)

The filtered content.

Parameters (1)

0. $feed_type — Optional. (constant) => null
The type of feed. rss2 | atom | rss | rdf

Usage

  1. if ( !function_exists( 'get_the_content_feed' ) ) { 
  2. require_once ABSPATH . WPINC . '/feed.php'; 
  3.  
  4. // The type of feed. rss2 | atom | rss | rdf 
  5. $feed_type = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = get_the_content_feed($feed_type); 
  9.  

Defined (1)

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

/wp-includes/feed.php  
  1. function get_the_content_feed($feed_type = null) { 
  2. if ( !$feed_type ) 
  3. $feed_type = get_default_feed(); 
  4.  
  5. /** This filter is documented in wp-includes/post-template.php */ 
  6. $content = str_replace(']]>', ']]>', $content); 
  7. /** 
  8. * Filters the post content for use in feeds. 
  9. * @since 2.9.0 
  10. * @param string $content The current post content. 
  11. * @param string $feed_type Type of feed. Possible values include 'rss2', 'atom'. 
  12. * Default 'rss2'. 
  13. */ 
  14. return apply_filters( 'the_content_feed', $content, $feed_type );