wp_throttle_comment_flood()WP 2.1.0

Determines whether a comment should be blocked because of comment flood.

Хуков нет.

Возвращает

true|false. Whether comment should be blocked.

Использование

wp_throttle_comment_flood( $block, $time_lastcomment, $time_newcomment );
$block(true|false) (обязательный)
Whether plugin has already blocked comment.
$time_lastcomment(int) (обязательный)
Timestamp for last comment.
$time_newcomment(int) (обязательный)
Timestamp for new comment.

Список изменений

С версии 2.1.0 Введена.

Код wp_throttle_comment_flood() WP 6.5.2

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