I have this query so far :
$user_args = array(
'role' => 'frontend_vendor',
'orderby' => 'display_name',
'order' => 'ASC',
'number' => $no,
'offset' => $offset
);
$user_query = new WP_User_Query( $user_args );
Now what I want to do is to get all users that has only posts, i have an example query that i want to do. how do i do this with wp_query()
?
SELECT users.id, posts.id
FROM wp_users
RIGHT JOIN wp_posts
ON wp_users.id = wp_posts.user_id
WHERE wp_posts.post_type="downloads"
AND wp_users.role="frontend_vendor"
ORDER BY display_name
ASC
LIMT 8
OFFEST 0
If the user has no posts, he should not be selected.