comment_id_fields() WordPress Function

The comment_id_fields() function is used to display a hidden field with the name and id of the current comment. This function is used by the comment reply form to help identify which comment is being replied to.

comment_id_fields( int $post_id ) #

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.

Top ↑

See also


Top ↑

Parameters

$post_id

(int)(Optional) Post ID. Defaults to the current post ID.


Top ↑

Source

File: wp-includes/comment-template.php

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


Top ↑

Changelog

Changelog
VersionDescription
2.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More