SnippetSpace SnippetSpace - 1 year ago 107
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:
'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 Source

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.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download