Skip to main content
added details to better explain the solution
Source Link
ksloan
  • 141
  • 3

what about just

$users = array_merge( get_users('role=subscriber'), get_users('role=contributor') ); 

WorksSince get_users() returns an array of users that match the query string given as a param. Just run the get_users() query for meevery role you want separately and merge the results. You can then loop through $users the same way you would have otherwise.

what about just

$users = array_merge( get_users('role=subscriber'), get_users('role=contributor') ); 

Works for me.

$users = array_merge( get_users('role=subscriber'), get_users('role=contributor') ); 

Since get_users() returns an array of users that match the query string given as a param. Just run the get_users() query for every role you want separately and merge the results. You can then loop through $users the same way you would have otherwise.

Source Link
ksloan
  • 141
  • 3

what about just

$users = array_merge( get_users('role=subscriber'), get_users('role=contributor') ); 

Works for me.