是否应该因评论泛滥而阻止评论。

原型

wp_throttle_comment_flood( bool $block, int $time_lastcomment, int $time_newcomment )

参数

$block (bool) (Required) 插件是否已阻止评论。

$time_lastcomment (int) (Required) 最后评论的时间戳。

$time_newcomment (int) (Required) 新评论的时间戳。

返回值

(bool)  是否应该阻止评论。

源文件

路径:wp-includes/comment.php

<?php
...
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;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_throttle_comment_flood/