Skip to content
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

Merged
merged 5 commits into from
Mar 18, 2016

Conversation

marcin-lawrowski
Copy link
Contributor

Fixes #829

It's a work in progress

$super_admins = get_super_admins();
foreach ( $super_admins as $admin ) {
$user = get_user_by ( 'login', $admin );
$users_array[] = $user;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@lukecarbis
Copy link
Contributor

@Chacha I've made a few changes in f4a600d. Could you please review, and if you're happy, merge?

@@ -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 );
Copy link
Contributor

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 Authors, not WP_Users. Hence the change.

@tylerhcarter
Copy link
Contributor

Tested. Good Job @marcin-lawrowski! 👍

@tylerhcarter tylerhcarter merged commit f4a600d into develop Mar 18, 2016
@lukecarbis lukecarbis deleted the bugfix/issue-829 branch March 18, 2016 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants