WordPress Version: 6.1
/**
* Determines whether a comment should be blocked because of comment flood.
*
* @since 2.1.0
*
* @param bool $block Whether plugin has already blocked comment.
* @param int $time_lastcomment Timestamp for last comment.
* @param int $time_newcomment Timestamp for new comment.
* @return bool Whether comment should be blocked.
*/
function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment)
{
if ($block) {
// A plugin has already blocked... we'll let that decision stand.
return $block;
}
if ($time_newcomment - $time_lastcomment < 15) {
return true;
}
return false;
}