comment_id_fields()
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.
Uses: get_comment_id_fields()
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
#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() comment id fields code WP 6.7.2
function comment_id_fields( $post = null ) { echo get_comment_id_fields( $post ); }