wp_throttle_comment_flood()
wp_throttle_comment_flood( bool $block, int $time_lastc…
wp_throttle_comment_flood( bool $block, int $time_lastcomment, int $time_newcomment )
是否因为评论泛滥而阻止评论。
Whether a comment should be blocked because of comment flood.
目录锚点:#参数#源码
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$block | (bool) | 插件是否已阻止注释。 |
$time_lastcomment | (int) | 最后一条注释的时间戳。 |
$time_newcomment | (int) | 新注释的时间戳。 |
源码(Source)
/** * Whether a comment should be blocked because of comment flood. * * @since 2.1.0 * * @param bool $block Whether plugin has already blocked comment. * @param int $time_lastcomment Timestamp for last comment. * @param int $time_newcomment Timestamp for new comment. * @return bool Whether comment should be blocked. */ 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;="" }="">
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
2.1.0 | wp-includes/comment.php | 6 | 8 |
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。
还没有任何评论,赶紧来占个楼吧!