comment_id_fields()WP 2.7.0

Output hidden input HTML for replying to comments.

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.

No Hooks.

Return

null. Nothing (null).

Usage

comment_id_fields( $post );
$post(int|WP_Post|null)
The post the comment is being displayed for.
Default: current global post

Examples

0

#1 Usage example

comment_id_fields()

Display:

<input type='hidden' name='comment_post_ID' value='119' id='comment_post_ID' />
<input type='hidden' name='comment_parent' id='comment_parent' value='251' />

Notes

Changelog

Since 2.7.0 Introduced.
Since 6.2.0 Renamed $post_id to $post and added WP_Post support.

comment_id_fields() code WP 6.5.3

function comment_id_fields( $post = null ) {
	echo get_comment_id_fields( $post );
}