Set up the post global variable in the comment feed loops so that any calls to post related template tags work correctly.

Ensures that atom feeds show threading for top-level comments correctly.
Fixes #14908 props solarissmoke and SergeyBiryukov.

git-svn-id: http://svn.automattic.com/wordpress/trunk@18716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2011-09-19 12:39:59 +00:00
parent 738904e996
commit 0826f08315
2 changed files with 2 additions and 4 deletions

View File

@ -42,8 +42,7 @@ echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '" ?' . '>'
<?php do_action('comments_atom_head'); ?>
<?php
if ( have_comments() ) : while ( have_comments() ) : the_comment();
$comment_post = get_post($comment->comment_post_ID);
get_post_custom($comment_post->ID);
$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
?>
<entry>
<title><?php

View File

@ -34,8 +34,7 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
<?php do_action('commentsrss2_head'); ?>
<?php
if ( have_comments() ) : while ( have_comments() ) : the_comment();
$comment_post = get_post($comment->comment_post_ID);
get_post_custom($comment_post->ID);
$comment_post = $GLOBALS['post'] = get_post( $comment->comment_post_ID );
?>
<item>
<title><?php