[wp-trac] [WordPress Trac] #38247: Use `is_main_site()` to determine whether to redirect network/user admin requests

WordPress Trac noreply at wordpress.org
Thu Oct 6 16:55:24 UTC 2016


#38247: Use `is_main_site()` to determine whether to redirect network/user admin
requests
--------------------------------+-----------------------------
 Reporter:  flixos90            |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:
 Severity:  normal              |   Keywords:  needs-patch
  Focuses:  multisite           |
--------------------------------+-----------------------------
 In `wp-admin/network/admin.php` and `wp-admin/user/admin.php` two similar
 checks are made to redirect to the main site if the current site's domain
 and path are different from the current network's domain and path. This
 can be simplified to use the `is_main_site()` method - if we're not on the
 main site of the current network, redirect to it.

 This also allows us to no longer access the `$current_blog` and
 `$current_site` globals in these places.

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


More information about the wp-trac mailing list