The wordpress built-in get_comments() can easily list out comments base on post type, post meta, post id or comment author id. But I would like to bring them togather, list out recent received comments from posts of specific author.
My current way can only simply list all comments out:
<?php
$store_ID = $store_user->ID;
$args = array(
'status' => 'approve',
'order' => 'DESC',
'orderby' => 'comment_date_gmt',
'meta_query' => array(
array(
'key' => 'rating',
'value' => array(''),
'compare' => 'NOT IN'
)
)
);
$comments = get_comments($args);
if ( count( $comments ) == 0 ) {
echo '<span colspan="5">None message here</span>';
} else {foreach ( $comments as $single_comment ) {
echo 'loop content';
}
?>
So I am looking for the part to specify the loop stay inside posts of sepcific author. May be some sql skills are needed?