From 3dc3dc25e9b8a9f966172e13e6bdbb7e15b5a7ec Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 4 Mar 2024 12:41:10 +0000 Subject: [PATCH] Docs: Document the `$post` global in comment feed templates. Follow-up to [18716]. Props viralsampat, sabernhardt. See #60021. Built from https://develop.svn.wordpress.org/trunk@57759 git-svn-id: http://core.svn.wordpress.org/trunk@57260 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/feed-atom-comments.php | 5 ++++- wp-includes/feed-rss2-comments.php | 5 ++++- wp-includes/version.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php index 37f663a337..1de77e3917 100644 --- a/wp-includes/feed-atom-comments.php +++ b/wp-includes/feed-atom-comments.php @@ -69,7 +69,10 @@ do_action( 'rss_tag_pre', 'atom-comments' ); comment_post_ID ); + $comment_post = get_post( $comment->comment_post_ID ); + /** + * @global WP_Post $post Global post object. + */ $GLOBALS['post'] = $comment_post; ?> diff --git a/wp-includes/feed-rss2-comments.php b/wp-includes/feed-rss2-comments.php index e0e664edaa..85a4079fa0 100644 --- a/wp-includes/feed-rss2-comments.php +++ b/wp-includes/feed-rss2-comments.php @@ -72,7 +72,10 @@ do_action( 'rss_tag_pre', 'rss2-comments' ); while ( have_comments() ) : the_comment(); - $comment_post = get_post( $comment->comment_post_ID ); + $comment_post = get_post( $comment->comment_post_ID ); + /** + * @global WP_Post $post Global post object. + */ $GLOBALS['post'] = $comment_post; ?> diff --git a/wp-includes/version.php b/wp-includes/version.php index 4dabe045cc..47671fd009 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-beta3-57758'; +$wp_version = '6.5-beta3-57759'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.