[wp-trac] [WordPress Trac] #37414: Use `get_network()` instead of global `$current_site`

WordPress Trac noreply at wordpress.org
Mon Aug 29 16:25:53 UTC 2016


#37414: Use `get_network()` instead of global `$current_site`
------------------------------------+------------------------
 Reporter:  flixos90                |       Owner:  flixos90
     Type:  enhancement             |      Status:  assigned
 Priority:  normal                  |   Milestone:  4.7
Component:  Networks and Sites      |     Version:  4.6
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:  multisite
------------------------------------+------------------------
Changes (by flixos90):

 * keywords:  needs-patch => has-patch dev-feedback


Comment:

 In [attachment:37414.diff] I replaced all instances of
 `get_current_site()` with `get_network()`, plus some related adjustments,
 like changing internal variable names from `$current_site` to
 `$current_network`.

 While `get_network()` is not available on some of these functions, this
 should not be a problem since there are `is_multisite()` checks in place
 that prevent it from being called. This was similar with
 `get_current_site()` as well, so I was not sure why the function was moved
 in [changeset:38388]. The global `$current_site` is not available on non-
 multisite, so I think that function should remain in an `ms-*.php` file.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37414#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list