From 2637a3d194521301eb66609bdf14527d928b8836 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 4 May 2024 19:11:11 +0000 Subject: [PATCH] Feeds: Add an optional `$post` parameter to `get_the_title_rss()`. This allows the function to be used outside of the loop and brings parity with `get_the_title()`. Follow-up to [1976], [3314], [21735]. Props khokansardar, oglekler. Fixes #61139. Built from https://develop.svn.wordpress.org/trunk@58096 git-svn-id: http://core.svn.wordpress.org/trunk@57561 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/feed.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 74a4b5009a..4532697ea5 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -150,11 +150,13 @@ function wp_title_rss( $deprecated = '–' ) { * Retrieves the current post title for the feed. * * @since 2.0.0 + * @since 6.6.0 Added the `$post` parameter. * + * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. * @return string Current post title. */ -function get_the_title_rss() { - $title = get_the_title(); +function get_the_title_rss( $post = 0 ) { + $title = get_the_title( $post ); /** * Filters the post title for use in a feed. diff --git a/wp-includes/version.php b/wp-includes/version.php index bb36779962..d401253c50 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-58095'; +$wp_version = '6.6-alpha-58096'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.