do_action( ‘comment_form’, int $post_id )

Fires at the bottom of the comment form, inside the closing form tag.


The post ID.

More Information

comment_form is a template hook triggered at the bottom of a form rendered by comment_form() right before the closing </form>.

Functions hooked to this action receive the post ID as a parameter.


do_action( 'comment_form', $post_id );



User Contributed Notes

  1. Skip to note 2 content
     * Displays an extra text area for more comments.
     * @param int $post_id The ID of the post where the comment form was rendered.
    function wporg_more_comments( $post_id ) {
    	echo '<p class="comment-form-more-comments"><label for="more-comments">' . __( 'More Comments', 'your-theme-text-domain' ) . '</label> <textarea id="more-comments" name="more-comments" cols="45" rows="8" aria-required="true"></textarea></p>';
    add_action( 'comment_form', 'wporg_more_comments' );

You must log in before being able to contribute a note or feedback.