Wordpress发表评论

时间:2016-04-29 13:01:38

标签: wordpress

我有一个Wordpress网站。我刚刚收到此特定错误消息

  

你是废话用户

当我在任何页面上发表评论时。

我查了wp-comments-post.php,但我一无所获。之前,它正在运作,但现在我不知道为什么会出现这个消息。

请告诉我可能是什么问题。以下是这封侮辱性消息的快照:

Here is a snapshot of this insulting message

2 个答案:

答案 0 :(得分:0)

1.转到wordpress文件中的以下路径。

  /wp-admin/options.php

2.在记事本中打开options.php然后通过ctrl + f

找到您的错误消息

3.如果删除它。

使用以下链接

查看用户的角色和功能

User roles

答案 1 :(得分:0)

“你是废话用户”是Block Spam Comments plugin在认为你的评论是垃圾邮件时显示的信息。

来自block-spam-comments.php

add_filter( 'preprocess_comment', 'verify_block_spam_comment' );

function verify_block_spam_comment( $commentdata ) {
    if ( ! isset( $_POST['is_legal_comment'] ) )
        wp_die( __( 'You are bullshit user' ) );

    return $commentdata;
}

该插件似乎写得不是很好,并且暂时没有更新。你可以找到更好的插件,比如实际上自带WordPress的Akismet。

您可能看到错误,因为其他一些脚本阻止了此脚本的JavaScript执行。或者,你可能关闭了JavaScript吗?这个插件使用jQuery,但是没有告诉WordPress将jQuery排入队列,所以如果你的主题没有排队,没有其他插件入队,你可能就没有加载jQuery。很难确切地知道为什么每次都认为你是垃圾邮件发送者。

如果您想保留此插件但使消息更友好,作者确实使用了WordPress的翻译功能之一,因此您可以使用自定义插件或主题的functions.php文件中的代码替换消息:

add_filter('gettext', 'too_much_bullshit_around_here', 20, 3);
function too_much_bullshit_around_here($translated_text, $text, $domain) {
    if('You are bullshit user' === $text) {
        return "If you are a spammer I must politely ask you to leave.";
    }
    return $translated_text;
}
相关问题