<?php
// functions.php
function imnobby_get_users_with_role($role){
 
 $args = array(
 'role' => $role,
 );
 
 $users = get_users( $args );
 
 $users_array = array();
 
 foreach ( $users as $user ) {
 array_push($users_array, $user-> user_login);
 }
 
 return $users_array;
 
}
Related Keywords: Developer, How-to, Solved, Get Username with User Role, functions.php, Script, Function