check_comment_flood

Fires immediately before a comment is marked approved.

Description

do_action( 'check_comment_flood', (string) $commentdata_comment_author_ip, (string) $commentdata_comment_author_email, (string) $commentdata_comment_date_gmt, (bool) $avoid_die ); 

Allows checking for comment flooding.

Parameters (4)

0. $commentdata_comment_author_ip (string)
The commentdata comment author ip.
1. $commentdata_comment_author_email (string)
The commentdata comment author email.
2. $commentdata_comment_date_gmt (string)
The commentdata comment date gmt.
3. $avoid_die (bool)
Whether to prevent executing wp_die() or die() if a comment flood is occurring.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'check_comment_flood', $commentdata_comment_author_ip, $commentdata_comment_author_email, $commentdata_comment_date_gmt, $avoid_die ); 
The following example is for adding a hook callback.
  1. // define the check_comment_flood callback 
  2. function action_check_comment_flood( $commentdata_comment_author_ip, $commentdata_comment_author_email, $commentdata_comment_date_gmt, $avoid_die ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'check_comment_flood', 'action_check_comment_flood', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'check_comment_flood', 'action_check_comment_flood', 10, 4 ); 

Defined (2)

The action is defined in the following location(s).

/wp-includes/comment.php  
  1. do_action( 
/wp-includes/default-filters.php  
  1. add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 );