get_the_title_rss() WordPress Function
The get_the_title_rss() function is used to display the title of a post in an RSS feed. This function is similar to the get_the_title() function, but with a few key differences. First, the get_the_title_rss() function escape any HTML entities in the title before displaying it. This ensures that the title will be displayed correctly in all RSS readers. Second, the get_the_title_rss() function will truncate the title if it is longer than 40 characters. This ensures that the title will not take up too much space in the RSS feed. Lastly, the get_the_title_rss() function will append a "Read more" link to the end of the title if the post is truncated. This allows RSS readers to easily access the full post if they are interested.
get_the_title_rss() #
Retrieve the current post title for the feed.
Return
(string) Current post title.
Source
File: wp-includes/feed.php
function get_the_title_rss() { $title = get_the_title(); /** * Filters the post title for use in a feed. * * @since 1.2.0 * * @param string $title The current post title. */ return apply_filters( 'the_title_rss', $title ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |