I am trying to get users that are either administrator, editor or author as their role from the wordpress database
$args = array('orderby' => 'post_count', 'order' => 'DESC','number' => 20, 'role' => 'administrator' );
That gets the administrator so i thought this would work
$args = array('orderby' => 'post_count', 'order' => 'DESC','number' => 20, 'role' => array('administrator','editor','author') );
It returned no results. ?
You cannot pass multiple roles in $args, you must call
get_usersonce for each roleFrom the documentation:
Note that “role” is singular in the parameter description. Call
get_usersonce for each role then merge the arrays together of the results