Last active
December 31, 2017 13:03
-
-
Save Dimasmagadan/5879145 to your computer and use it in GitHub Desktop.
#WordPress Comments Query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$args = array( | |
'author_email' => '', | |
'ID' => '', | |
'karma' => '', | |
'number' => '', | |
'offset' => '', | |
'orderby' => '', | |
'order' => 'DESC', | |
'parent' => '', | |
'post_ID' => '', | |
// 'post_id' => 0, | |
'post_author' => '', | |
'post_name' => '', | |
'post_parent' => '', | |
'post_status' => '', | |
'post_type' => '', | |
'status' => '', | |
'type' => '', | |
'user_id' => '', | |
'search' => '', | |
'count' => false, | |
'meta_key' => '', | |
'meta_value' => '', | |
'meta_query' => '' | |
); | |
$comments_query = new WP_Comment_Query; | |
$comments = $comments_query->query( $args ); | |
// Comment Loop | |
if ( $comments ) { | |
foreach ( $comments as $comment ) { | |
echo $comment->comment_content; | |
} | |
} else { | |
// no comments | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment