comment_flood_filter
Filters the comment flood status.
Использование
add_filter( 'comment_flood_filter', 'wp_kama_comment_flood_filter', 10, 3 );
/**
* Function for `comment_flood_filter` filter-hook.
*
* @param bool $bool Whether a comment flood is occurring.
* @param int $time_lastcomment Timestamp of when the last comment was posted.
* @param int $time_newcomment Timestamp of when the new comment was posted.
*
* @return bool
*/
function wp_kama_comment_flood_filter( $bool, $time_lastcomment, $time_newcomment ){
// filter...
return $bool;
}
- $bool(true|false)
- Whether a comment flood is occurring.
По умолчанию: false - $time_lastcomment(int)
- Timestamp of when the last comment was posted.
- $time_newcomment(int)
- Timestamp of when the new comment was posted.
Список изменений
| С версии 2.1.0 | Введена. |
Где вызывается хук
wp-includes/comment.php 896
$flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );
Где используется хук в WordPress
wp-includes/default-filters.php 311
add_filter( 'comment_flood_filter', 'wp_throttle_comment_flood', 10, 3 );