当前位置: > 技术档案 > “您提交评论的速度太快了,请稍后再发表评论。”的解决办法

“您提交评论的速度太快了,请稍后再发表评论。”的解决办法

1.关于评论间隔
控制评论过快输出的函数是在wp-includes\comment.php下的check_comment_flood_db()函数,其调用了一个叫comment_flood_filter的apply_filters,该apply_filters在文件wp-includes\default-filters.php下被定义为add_filter( 'comment_flood_filter',     'wp_throttle_comment_flood',    10, 3 );从而在wp-includes\comment.php下找到名为wp_throttle_comment_flood()的函数,其定义为
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;
}
其中的15即评论间隔时间,在wp-content\languages\zh-CN.po文件中将"You are posting comments too quickly. Slow down."翻译成了"您提交评论的速度太快了,请稍后再发表评论。"
打赏作者

网友评论1

  1. 沙发
    Johnette:

    Naturally, you cannot ignore the fact that you will be able to enjoy these
    games for absolutely nothing from the wallet.

    2019-05-01 9:06 上午 [回复]

发表评论

表情
还能输入210个字