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.


Top ↑

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 );
}


Top ↑

Changelog

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