[wp-trac] [WordPress Trac] #63536: Super Admin Functions Network ID Support

WordPress Trac noreply at wordpress.org
Thu Jun 5 13:48:55 UTC 2025


#63536: Super Admin Functions Network ID Support
--------------------------------+-----------------------------
 Reporter:  spenserhale         |      Owner:  (none)
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 Multisite installs that host multiple networks currently treat all super-
 admin functions as being tied to the primary network. This limits
 enterprise-scale setups (e.g., SaaS platforms that shard customers into
 separate networks)

 The patch introduces first-class, backward-compatible support for a
 $network_id argument in four super-admin helpers, allowing each network to
 maintain an independent site_admins list while preserving legacy behavior.

 Scope of Code Changes
 The four helpers—get_super_admins(), is_super_admin(),
 grant_super_admin(), and revoke_super_admin()—now accept an optional
 $network_id parameter.
 They now call get_network_option() / update_network_option() when a
 network ID is supplied; otherwise they keep using the current network
 (maintaining old behaviour).
 Early returns and the global $super_admins override are preserved exactly
 as before.

 Design and Back-Compatibility
 Calling without $network_id still works exactly as today.
 Calling with a specific $network_id now targets that network’s site_admins
 row.
 If $GLOBALS['super_admins'] is defined, it still overrides everything and
 the new code short-circuits.
 Plugin hooks (grant_super_admin, granted_super_admin, revoke_super_admin,
 revoked_super_admin) now receive $network_id as a second argument, but
 positional callbacks remain compatible.

 All DocBlocks have been updated to describe the new parameter.
 Hook signatures are extended but remain backward-compatible.
 The change is fully transparent unless developers opt into the new
 argument.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63536>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list