wordpress - 等待审核消息未显示在 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。在发布到这里之前,我确实停用了我激活的每个插件。我还使用不同的帐户和角色对此进行了测试。
解决方案
显然,解决方案是让“在我下次发表评论时在此浏览器中保存我的姓名、电子邮件和网站”。选中复选框以显示消息。
因此,您必须选中 GDPR 复选框才能在批准之前显示评论和消息。
抱歉打扰了。
推荐阅读
- mysql - MySQL 查询检索 MAX 值不适用于十进制数
- erlang - 将数百万条记录写入 mnesia 表会占用大量内存(RAM)并且即使这些记录被删除也不会回收
- cypress - 珀西没有在 CircleCI 球体中运行(带赛普拉斯)
- android - 如何将一种颜色从位图更改为另一种颜色
- c# - 在自定义 datetimePicker 上单击一个月后,它仍然显示日期选择窗口
- reactjs - 当屏幕最小化和工作区由两个单词组成时更改卡片的形状
- flutter - 为什么这个水平列表视图不能在颤动的 Web 上滚动?
- php - Recursively rename caps in array keys to dash and lower case
- google-chrome - 输出 console.dir 时 VS Code 中的类似 Chrome 控制台的终端
- c - 打印给定矩阵中每一行的最大值