Pass post id along to *comment_id_fields(). Props natecook. fixes #17193

git-svn-id: http://svn.automattic.com/wordpress/trunk@17812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-05-05 19:33:47 +00:00
parent 4141e704e5
commit 29592dafb6
1 changed files with 6 additions and 5 deletions

View File

@ -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 = "<input type='hidden' name='comment_post_ID' value='$id' id='comment_post_ID' />\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 ) {
<?php echo $args['comment_notes_after']; ?>
<p class="form-submit">
<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
<?php comment_id_fields(); ?>
<?php comment_id_fields( $post_id ); ?>
</p>
<?php do_action( 'comment_form', $post_id ); ?>
</form>