-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include super admins to the users list in Exclude settings #835
Conversation
$super_admins = get_super_admins(); | ||
foreach ( $super_admins as $admin ) { | ||
$user = get_user_by ( 'login', $admin ); | ||
$users_array[] = $user; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if the user already exists in the array first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I choose to check for duplicates further in the foreach loop.
@@ -464,10 +464,14 @@ function( $user_id ) { | |||
); | |||
|
|||
if ( is_multisite() && is_super_admin() ) { | |||
$super_admins = get_super_admins(); | |||
foreach ( $super_admins as $admin ) { | |||
$users[] = get_user_by( 'login', $admin ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This array is an array of Author
s, not WP_User
s. Hence the change.
Tested. Good Job @marcin-lawrowski! 👍 |
Fixes #829
It's a work in progress