comment_form WordPress Action Hook

The comment_form hook is used to display the comment form on a post or page. This hook is typically used by plugins to add custom fields to the comment form.

do_action( 'comment_form', int $post_id ) #

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


Parameters

$post_id

(int)The post ID.


Top ↑

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.


Top ↑

Source

File: wp-includes/comment-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.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