user3003106 user3003106 - 1 year ago 81
PHP Question

wordpress - show comments only comments who are approved

i am building some kind of a comments archive,
i was looking here:

and saw no "array" that can help me...

this is part of my code:

function process_post(){
Function sheker() {
$args = array(
what to put here ??????????????

// The Query
$comments_query = new WP_Comment_Query;
$comments = $comments_query->query( $args );

// Comment Loop

any ideas ?

Answer Source

Using following code you can get all comments that are approved (Check Parameters)

$args = array('status'=>'approve');
$comments = new WP_Comment_Query( $args );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download