wordpress / latest / hooks / check_comment_flood.html

do_action( 'check_comment_flood', string $comment_author_ip, string $comment_author_email, string $comment_date_gmt, bool $wp_error )

Fires immediately before a comment is marked approved.

Description

Allows checking for comment flooding.

Parameters

$comment_author_ip string
Comment author's IP address.
$comment_author_email string
Comment author's email.
$comment_date_gmt string
GMT date the comment was posted.
$wp_error bool
Whether to return a WP_Error object instead of executing wp_die() or die() if a comment flood is occurring.
More Arguments from wp_die( ... $args ) Arguments to control behavior. If $args is an integer, then it is treated as the response code.
  • responseint
    The HTTP response code. Default 200 for Ajax requests, 500 otherwise.
  • link_urlstring
    A URL to include a link to. Only works in combination with $link_text.
    Default empty string.
  • link_textstring
    A label for the link to include. Only works in combination with $link_url.
    Default empty string.
  • back_linkbool
    Whether to include a link to go back. Default false.
  • text_directionstring
    The text direction. This is only useful internally, when WordPress is still loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'.
    Default is the value of is_rtl() .
  • charsetstring
    Character set of the HTML output. Default 'utf-8'.
  • codestring
    Error code to use. Default is 'wp_die', or the main error code if $message is a WP_Error.
  • exitbool
    Whether to exit the process after completion. Default true.

Source

File: wp-includes/comment.php. View all references

do_action(
	'check_comment_flood',
	$commentdata['comment_author_IP'],
	$commentdata['comment_author_email'],
	$commentdata['comment_date_gmt'],
	$wp_error
);

Used By

Used By Description

Changelog

Version Description
5.5.0 The $avoid_die parameter was renamed to $wp_error.
4.7.0 The $avoid_die parameter was added.
2.3.0 Introduced.

© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/check_comment_flood