W3cubDocs

/WordPress

get_the_title_rss( int|WP_Post $post ): string

Retrieves the current post title for the feed.

Parameters

$postint|WP_Postoptional
Post ID or WP_Post object. Default is global $post.

Return

string Current post title.

Source

function get_the_title_rss( $post = 0 ) {
	$title = get_the_title( $post );

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

Hooks

apply_filters( ‘the_title_rss’, string $title )

Filters the post title for use in a feed.

Changelog

Version Description
6.6.0 Added the $post parameter.
2.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_the_title_rss