钩子文档

comment_flood_trigger

💡 云策文档标注

概述

comment_flood_trigger 是一个 WordPress 动作钩子,在触发评论洪水消息之前执行。它允许开发者在检测到评论洪水时进行自定义处理。

关键要点

  • 这是一个动作钩子,用于在评论洪水消息触发前执行自定义代码。
  • 钩子接收两个参数:$time_lastcomment(上次评论的时间戳)和 $time_newcomment(新评论的时间戳)。
  • 主要用于 wp_check_comment_flood() 函数中,以检查评论洪水情况。
  • 自 WordPress 1.5.0 版本引入。

代码示例

do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );

注意事项

开发者可以添加自定义函数到这个钩子,以处理评论洪水事件,例如记录日志或发送通知。


📄 原文内容

Fires before the comment flood message is triggered.

Parameters

$time_lastcommentint
Timestamp of when the last comment was posted.
$time_newcommentint
Timestamp of when the new comment was posted.

Source

do_action( 'comment_flood_trigger', $time_lastcomment, $time_newcomment );

Changelog

Version Description
1.5.0 Introduced.