Php 按已批准的筛选wordpress评论

Php 按已批准的筛选wordpress评论,php,wordpress,comments,wordpress-theming,Php,Wordpress,Comments,Wordpress Theming,我使用此选项获取自定义主题的wordpress评论: get_comments( array('status' => 'aprove','order' => 'ASC', 'post_id' => $newpost->ID) ); 除了等待审核的评论没有被过滤之外,一切都是有效的。 遵循法典:“状态”=>“批准”应该过滤掉这些内容,但这似乎没有发生 我不是用对了吗?试着用两个p来批准 get_comments( array('status' => 'approve

我使用此选项获取自定义主题的wordpress评论:

get_comments( array('status' => 'aprove','order' => 'ASC', 'post_id' => $newpost->ID) );
除了等待审核的评论没有被过滤之外,一切都是有效的。 遵循法典:
“状态”=>“批准”
应该过滤掉这些内容,但这似乎没有发生


我不是用对了吗?

试着用两个p来批准

get_comments( array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID) );

这是(你链接到
获取评论
单数)。

用两个Ps尝试
批准

get_comments( array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID) );

这是(您链接到
获取注释
单数)。

它对我有效。您可以使用以下代码在段落中显示您批准的注释

<?php foreach (get_comments(array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID)) as $comment): ?>
<div class="comment-show"><h4><?php echo $comment->comment_author; ?> said: </h4> <p>"<?php echo $comment->comment_content; ?>"</p></div>
<?php endforeach; ?>

说:“”

我已经在下面的网站上使用显示评论

它对我有效。您可以使用以下代码在段落中显示您批准的评论

<?php foreach (get_comments(array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID)) as $comment): ?>
<div class="comment-show"><h4><?php echo $comment->comment_author; ?> said: </h4> <p>"<?php echo $comment->comment_content; ?>"</p></div>
<?php endforeach; ?>

说:“”

我已经在下面的网站上使用显示评论

这发生在我们中最好的人身上!这发生在我们最好的人身上!