wp_throttle_comment_flood
Whether a comment should be blocked because of comment flood.
Description
Parameters (3)
- 0. $block (bool)
- Whether plugin has already blocked comment.
- 1. $time_lastcomment (int)
- Timestamp for last comment.
- 2. $time_newcomment (int)
- Timestamp for new comment.
Usage
if ( !function_exists( 'wp_throttle_comment_flood' ) ) { require_once ABSPATH . WPINC . '/comment.php'; } // Whether plugin has already blocked comment. $block = true; // Timestamp for last comment. $time_lastcomment = -1; // Timestamp for new comment. $time_newcomment = -1; // NOTICE! Understand what this does before running. $result = wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/comment.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;
- }