Created
January 7, 2019 18:42
-
-
Save kellenmace/19a44872b916592269d3dcad27a18f95 to your computer and use it in GitHub Desktop.
Get all non-Super Admin users in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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