Get User by Role?
-
So I’ve been able to bring up the selected roles, but I can’t figure out how to bring up users with those selected roles? Specifically the users’ email addresses? Here is what I have so far.. I am also testing this outside the loop.
<?php //** get field $roles = the_field('user_notification'); ?> <?php //get users with the selected role foreach ( $roles as $user ) { $roles = array_merge( get_users($user->$roles)); echo($user->user_email); }//end for each ?>
DO I have the wrong syntax or am I way off here? Any help is appreciated.. I’m can’t seem to find much documentation on this.
Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get User by Role?’ is closed to new replies.