List members from particaular user role via php
-
I want to show a list of all the members from a user role I have set up called ‘Corporate’.
I tried the following but with no joy:
<?php $blogusers = get_users( 'role_select=Corportate' ); // Array of WP_User objects. foreach ( $blogusers as $user ) { echo '<p>' . esc_html( $user->user_email ) . '</p>'; } ?>
Is this close?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘List members from particaular user role via php’ is closed to new replies.