the_excerpt_rss
Called by the the_excerpt_rss() function, which outputs a short description in an RSS feed. Passes the short description text so it can be changed.
the_excerpt_rss is used by plugins to change the short description (excerpt) text in feeds. For example, this hook can add a site link to the short description in an RSS feed (see the example).
Usage
add_filter( 'the_excerpt_rss', 'wp_kama_the_excerpt_rss_filter' );
/**
* Function for `the_excerpt_rss` filter-hook.
*
* @param string $output The current post excerpt.
*
* @return string
*/
function wp_kama_the_excerpt_rss_filter( $output ){
// filter...
return $output;
}
- $output(string)
- The post's short description text that will be output by the_excerpt_rss().
Examples
#1 Site copyright at the end of the short description in an RSS feed.
This example shows how to add any text (copyright in this case) to the end of a post excerpt. The excerpt is output in the RSS feed in XML format.
add_filter( 'the_excerpt_rss', 'add_text_to_the_feed_end' );
function add_text_to_the_feed_end( $content ){
$content .= '<p>© example.com, 2014</p>';
return $content;
}Changelog
| Since 1.2.0 | Introduced. |
Where the hook is called
the_excerpt_rss
wp-includes/feed.php 236
echo apply_filters( 'the_excerpt_rss', $output );
Where the hook is used in WordPress
wp-includes/default-filters.php 263
add_filter( 'the_excerpt_rss', 'convert_chars' );
wp-includes/default-filters.php 264
add_filter( 'the_excerpt_rss', 'ent2ncr', 8 );