Skip to content

Instantly share code, notes, and snippets.

@kellenmace
Created January 7, 2019 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellenmace/19a44872b916592269d3dcad27a18f95 to your computer and use it in GitHub Desktop.
Save kellenmace/19a44872b916592269d3dcad27a18f95 to your computer and use it in GitHub Desktop.
Get all non-Super Admin users in WordPress
<?php
/**
* Get all non-Super Admin users on the current site.
*
* @return array WP_User objects.
*/
function get_all_non_superadmin_users() {
return get_users([
'login__not_in' => get_super_admins()
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment