title: Filter wordpress comments by user role
body: <p>Trying to filter all my comments by a specific user role. In this case, the user role is called group1.  This will return all comments only when I remove <code>WHERE m.meta_key = 'wp_capabilities' AND m.meta_value = 'group1'</code>
  from the query below.</p>
  
  <pre><code>$query = $wpdb-&gt;prepare( "
  SELECT *
    FROM $wpdb-&gt;comments c
    LEFT 
    JOIN $wpdb-&gt;commentmeta cm 
      ON c.comment_ID = cm.comment_id
    LEFT 
    JOIN $wpdb-&gt;users u 
      ON c.user_id = u.ID
    LEFT 
    JOIN $wpdb-&gt;usermeta m 
      ON m.user_id = u.ID
   WHERE c.comment_post_ID = %s
     AND c.comment_approved = 1
   WHERE m.meta_key = 'wp_capabilities'
     AND m.meta_value = 'group1'
   ORDER 
      BY c.comment_ID $comment_order
                      ",
                      $post-&gt;ID);
  </code></pre>