Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#40406 closed enhancement (fixed)

Replace `is_super_admin()` check when setting up multisite

Reported by: flixos90's profile flixos90 Owned by: flixos90's profile flixos90
Milestone: 4.8 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: needs-patch
Focuses: multisite Cc:


When setting up multisite, an is_super_admin() check is made in populate_network(). As discussed with @johnbillion at WordCamp Torino, that check can easily be removed, and instead the previous query can be adjusted to query users with the administrator role only.

This ticket is part of the #37616 task and is described in

Attachments (1)

40406.diff (856 bytes) - added by flixos90 7 years ago.

Download all attachments as: .zip

Change History (2)

7 years ago

#1 @flixos90
7 years ago

  • Owner set to flixos90
  • Resolution set to fixed
  • Status changed from new to closed

In 40406:

Multisite: Replace unnecessary is_super_admin() check when setting up the initial network.

When using is_super_admin() in a non-multisite environment, the function is supposed to check for administrator capabilities. The process of querying all users and filtering them with that function can be optimized by only querying users with the administrator role instead.

Fixes #40406. See #37616.

Note: See TracTickets for help on using tickets.