From e73ec3abe09aea47b3885073189ec8159bdca95e Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 5 May 2011 19:33:47 +0000 Subject: [PATCH] Pass post id along to *comment_id_fields(). Props natecook. fixes #17193 git-svn-id: https://develop.svn.wordpress.org/trunk@17812 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-template.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index d00c659946..ce0f9ddbb8 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -1162,8 +1162,9 @@ function cancel_comment_reply_link($text = '') { * * @return string Hidden input HTML for replying to comments */ -function get_comment_id_fields() { - $id = get_the_ID(); +function get_comment_id_fields( $id = 0 ) { + if ( empty( $id ) ) + $id = get_the_ID(); $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; $result = "\n"; @@ -1177,8 +1178,8 @@ function get_comment_id_fields() { * @since 2.7.0 * @see get_comment_id_fields() Echoes result */ -function comment_id_fields() { - echo get_comment_id_fields(); +function comment_id_fields( $id = 0 ) { + echo get_comment_id_fields( $id ); } /** @@ -1573,7 +1574,7 @@ function comment_form( $args = array(), $post_id = null ) {

- +