comment_flood_filter
Filter HookDescription
Filters the comment flood status.Hook Information
File Location |
wp-includes/comment.php
View on GitHub
|
Hook Type | Filter |
Line Number | 887 |
Hook Parameters
Type | Name | Description |
---|---|---|
bool
|
$bool
|
Whether a comment flood is occurring. Default false. |
int
|
$time_lastcomment
|
Timestamp of when the last comment was posted. |
int
|
$time_newcomment
|
Timestamp of when the new comment was posted. |
Usage Examples
Basic Usage
<?php
// Hook into comment_flood_filter
add_filter('comment_flood_filter', 'my_custom_filter', 10, 3);
function my_custom_filter($bool, $time_lastcomment, $time_newcomment) {
// Your custom filtering logic here
return $bool;
}
Source Code Context
wp-includes/comment.php:887
- How this hook is used in WordPress core
<?php
882 *
883 * @param bool $bool Whether a comment flood is occurring. Default false.
884 * @param int $time_lastcomment Timestamp of when the last comment was posted.
885 * @param int $time_newcomment Timestamp of when the new comment was posted.
886 */
887 $flood_die = apply_filters( 'comment_flood_filter', false, $time_lastcomment, $time_newcomment );
888
889 if ( $flood_die ) {
890 /**
891 * Fires before the comment flood message is triggered.
892 *
PHP Documentation
<?php
/**
* Filters the comment flood status.
*
* @since 2.1.0
*
* @param bool $bool Whether a comment flood is occurring. Default false.
* @param int $time_lastcomment Timestamp of when the last comment was posted.
* @param int $time_newcomment Timestamp of when the new comment was posted.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/comment.php
Related Hooks
Related hooks will be displayed here in future updates.