首页 > 解决方案 > 等待审核消息未显示在 WordPress 4.9.6 中

问题描述

我正在处理我的评论部分。

我有一个非常基本的习惯Comment_Walker。但在发表评论后,它不会显示“等待审核”字符串。

评论已成功发布到后端。我已勾选必须在后端设置中手动批准评论。评论在后端的评论部分显示为“待处理”。但是发表评论时我不会收到消息。

我的 Walker 文件(非常基本的简化为演示)

<?php
/** Custom Comment Walker Basic */

class Custom_Comment_Walker extends Walker_Comment {

    protected function html5_comment( $comment, $depth, $args ) {

        $tag = ( $args['style'] === 'div' ) ? 'div' : 'li';
        ?>      
        <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( $this->has_children ? 'has-children col-12 p-0' : 'p-0 col-12 list-unstyled' ); ?>>


        <div>
            <?php echo get_comment_text(); ?>
            <?php if ( '0' == $comment->comment_approved ) : ?>
                Awaiting Moderation
            <?php endif; ?>  
        </div>

        <?php
    }   
}

通过以下方式访问它:

<div class="comment-list">
    <?php 
      wp_list_comments( array(
          'walker'        => new Custom_Comment_Walker()
      ) );
    ?>
</div>

我不太明白为什么该消息不会显示。我在这里监督什么吗?在本地主机上使用最新的 WordPress 4.9.6。在发布到这里之前,我确实停用了我激活的每个插件。我还使用不同的帐户和角色对此进行了测试。

标签: wordpresscomments

解决方案


显然,解决方案是让“在我下次发表评论时在此浏览器中保存我的姓名、电子邮件和网站”。选中复选框以显示消息。

因此,您必须选中 GDPR 复选框才能在批准之前显示评论和消息。

抱歉打扰了。


推荐阅读