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 ); 

Allows checking for comment flooding.

Parameters (3)

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.

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 ); 
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 ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'check_comment_flood', 'action_check_comment_flood', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'check_comment_flood', 'action_check_comment_flood', 10, 3 ); 

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, 3 );