按批准过滤 wordpress 评论

cmp*_*ger 0 php wordpress comments wordpress-theming

我用它来为我的自定义主题获取 wordpress 评论:

get_comments( array('status' => 'aprove','order' => 'ASC', 'post_id' => $newpost->ID) );
Run Code Online (Sandbox Code Playgroud)

除了等待审核的评论未被过滤这一事实之外,一切正常。遵循法典:http : //codex.wordpress.org/Function_Reference/get_comment'status' => 'approve'应该过滤掉那些,但这似乎没有发生。

我没有正确使用它吗?

cro*_*nah 5

approve用两个P试试!

get_comments( array('status' => 'approve','order' => 'ASC', 'post_id' => $newpost->ID) );
Run Code Online (Sandbox Code Playgroud)

这是get_comments 的文档页面(您链接到get_comment单数。)