Another question about Populate dropdown list with members
-
I found your snippet in another thread
function get_all_approved_users() { $args = array( 'fields' => array( 'ID', 'user_login' ), 'orderby' => 'user_login', 'meta_query' => array( 'relation' => 'AND', array( 'key' => 'account_status', 'value' => 'approved', 'compare' => '=' )), ); $users = get_users( $args ); $all_users = array(); foreach( $users as $user ) { $all_users[$user->user_login] = $user->user_login; } return $all_users; }
and tried to adapt it list all users of a specific UM-created role. I tried:
array( 'key' => 'role_select', 'value' => 'Supervisor', 'compare' => '=' )),
I also tried ‘um_supervisor’ for the value–neither worked. I suspect I am using the wrong key, but can’t figure out what it should be.
Any thoughts/hints/suggestions?
Thanks!
–don
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Another question about Populate dropdown list with members’ is closed to new replies.