SnippetSpace SnippetSpace - 5 months ago 22
PHP Question

Filter wordpress comments by approved

I use this to get wordpress comments for my custom themes:

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


Everything works besides the fact that comments that are awaiting moderation are not filtered.
Following the codex: http://codex.wordpress.org/Function_Reference/get_comment
'status' => 'aprove'
should filter those out but that doesn't seem to happen.

Didn't I use it the right way?

Thanks for your help!

Answer

Try approve with two Ps!

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

Here's the docs page for get_comments (you linked to get_comment singular.)