Action hook 'comment_form'

in WP Core File wp-includes/comment-template.php at line 2899

View Source

comment_form

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

Hook Information

File Location wp-includes/comment-template.php View on GitHub
Hook Type Action
Line Number 2899

Hook Parameters

Type Name Description
int $post_id The post ID.

Usage Examples

Basic Usage
<?php
// Hook into comment_form
add_action('comment_form', 'my_custom_function', 10, 1);

function my_custom_function($post_id) {
    // Your custom code here
}

Source Code Context

wp-includes/comment-template.php:2899 - How this hook is used in WordPress core
<?php
2894  			 *
2895  			 * @since 1.5.0
2896  			 *
2897  			 * @param int $post_id The post ID.
2898  			 */
2899  			do_action( 'comment_form', $post_id );
2900  
2901  			echo '</form>';
2902  
2903  		endif;
2904  		?>

PHP Documentation

<?php
/**
			 * Fires at the bottom of the comment form, inside the closing form tag.
			 *
			 * @since 1.5.0
			 *
			 * @param int $post_id The post ID.
			 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.