//评论过滤
function refused_spam_comments( $comment_data ) {
$pattern = '/[一-龥]/u';
$jpattern ='/[ぁ-ん]+|[ァ-ヴ]+/u';
if(!preg_match($pattern,$comment_data['comment_content'])) {
err('写点汉字吧,博主外语很捉急!You should type some Chinese word!');
}
if(preg_match($jpattern, $comment_data['comment_content'])) {
err('日文滚粗!Japanese Get out!日本語出て行け! You should type some Chinese word!');
}
return( $comment_data );
}
add_filter('preprocess_comment','refused_spam_comments');