comment query based on user id
// WP_Comment_Query arguments
$args = array(
'status' => 'approve',
'type' => 'comment',
'post_type' => 'recipe',
'user_id' => '1',
'number' => '-1',
'orderby' => 'comment_date',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'order_processed_for_zap_catch',
'compare' => 'NOT EXISTS',
),
array(
),
),
'count' => true,
);
// The Comment Query
$photoGalleryComments = new WP_Comment_Query( $args );
// The Comment Loop
if ( $photoGalleryComments ) {
foreach ( $photoGalleryComments as $comment ) {
// do something
}
} else {
// no comments found
}