Action hook 'comment_form_before'

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

View Source

comment_form_before

Action Hook
Description
Fires before the comment form.

Hook Information

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

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into comment_form_before
add_action('comment_form_before', 'my_custom_function');

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

Source Code Context

wp-includes/comment-template.php:2700 - How this hook is used in WordPress core
<?php
2695  	/**
2696  	 * Fires before the comment form.
2697  	 *
2698  	 * @since 3.0.0
2699  	 */
2700  	do_action( 'comment_form_before' );
2701  	?>
2702  	<div id="respond" class="<?php echo esc_attr( $args['class_container'] ); ?>">
2703  		<?php
2704  		echo $args['title_reply_before'];
2705  

PHP Documentation

<?php
/**
	 * Fires before the comment form.
	 *
	 * @since 3.0.0
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.