等待审核消息未在WordPress 4.9.6中显示

时间:2018-06-16 21:20:34

标签: wordpress comments

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

我有一个非常基本的自定义Comment_Walker。但它并没有显示出等待审核的情况"发表评论后的字符串。

评论已成功发布到后端。我已勾选注释必须在后端的设置中手动批准。 评论在后端的评论部分中显示为" pending"。但是在发表评论时我没有收到消息。

我的沃克文件(非常基本的简化演示)

<?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。在我发布之前,我确实已经停用了每个我已经活跃过的插件。我还用不同的帐户和角色对此进行了测试。

1 个答案:

答案 0 :(得分:1)

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

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

很抱歉打扰。