Load user by specific role
One possible way is by using the role__not_in parameter like so which excludes all other roles except subscriber: // Include only the following role(s): $roles_in = array( ‘subscriber’ ); $roles_not_in = array_diff( array_keys( wp_roles()->get_names() ), $roles_in ); $args = array( ‘role__not_in’ => $roles_not_in, ); $subscribers = get_users( $args ); But of course, if you know … Read more