Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP User Query && multiple roles
<?php
/**
* Gell all users that have role1 and users that have role2 and role n...
* @link https://codex.wordpress.org/Function_Reference/get_users
* @link http://wordpress.stackexchange.com/a/209593/31376
*
* @param $args
* @since 4.4
*/
$users = get_users( [ 'role__in' => [ 'administrator', 'subscriber', 'author' ] ]);
var_dump( $users );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment