user3003106 user3003106 - 7 days ago 6
PHP Question

wordpress - show comments only comments who are approved

i am building some kind of a comments archive,
i was looking here:
http://codex.wordpress.org/Function_Reference/get_comments

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

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

$args = array('status'=>'approve');
$comments = new WP_Comment_Query( $args );