[wp-trac] [WordPress Trac] #12217: get_comment_reply_link gets post ID from wrong place

WordPress Trac wp-trac at lists.automattic.com
Sat Feb 13 12:00:13 UTC 2010


#12217: get_comment_reply_link gets post ID from wrong place
--------------------------+-------------------------------------------------
 Reporter:  juggledad     |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  General       |     Version:  2.9.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 I've been tracking down an issue with comments. In the Atahualpa theme,
 you can have comments on pages, but it only allows a reply on the first
 comment.

 Digging my way thru the code, I came to function get_comment_reply_link
 and there are two lines that I wonder about. They are right after the
 'extract($args, EXTR_SKIP);' and are:

    $comment = get_comment($comment);
    $post = get_post($post);

 now it seems to me that the second line should be

    $comment = get_comment($comment);
    $post = get_post($comment->comment_post_ID);

 i.e. grab the post from the post pointed to by the comment. You want to
 walk from teh comment to the post that it is pointed to, not assume that
 you have the post already.

 Am I missing something? (p.s. this fixes my issue and allows all page
 comments to be replied to.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12217>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list