comment_id_fields( int|WP_Post|null $post = null )

Outputs hidden input HTML for replying to comments.


Description

Adds two hidden inputs to the comment form to identify the comment_post_ID and comment_parent values for threaded comments.

This tag must be within the <form> section of the comments.php template.

See also


Parameters

$post

(Optional) The post the comment is being displayed for.<br> Defaults to the current global post.

Default value: null


Source

File: wp-includes/comment-template.php

function comment_id_fields( $id = 0 ) {
	echo get_comment_id_fields( $id );
}


Changelog

Changelog
Version Description
6.2.0 Renamed $post_id to $post and added WP_Post support.
2.7.0 Introduced.