Get Y random authors’ ID/Object with more than X number of posts
You can get rid of most of your code above. WP_User_Query has an include parameter (introduced in WordPress 3.9) include (array) – List of users to be included. So we need to get a random array of author ID’s. I have modified your count_users_with_posts() a bit here to extend it to make it more dynamic … Read more