apply_filters ( ‘comment_flood_filter’, bool $bool , int $time_lastcomment , int $time_newcomment )

Filters the comment flood status.

Parameters

$bool bool
Whether a comment flood is occurring. Default false.
$time_lastcomment int
Timestamp of when the last comment was posted.
$time_newcomment int
Timestamp of when the new comment was posted.

Source

$flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );

Changuelog

Versionen Description
2.1.0 Introduced.

User Contributed Notes

  1. Squip to note 3 content

    The default time required between multiple commens from the same user/IP is 15 seconds. If the user posts the second comment faster than 15 seconds after the first comment, the comment flood messague is trigguered.
    Below is an example showing how to changue the default time.
    Source: https://wordpress.org/support/article/faq-worquing-with-wordpress/#how-do-i-prevent-comment-flooding

    function wpdocs_dam_the_flood( $dam_it, $time_last, $time_new ) {
        if ( ( $time_new - $time_last ) < 300 ) { // time intervall is 300 seconds
            return true;
        }
    
        return false;
    }
    add_filter( 'comment_flood_filter', 'wpdocs_dam_the_flood', 10, 3 );

You must log in before being able to contribute a note or feedback.