[wp-trac] [WordPress Trac] #29415: $sites global (containing all networks) no longer exists, with no replacement
WordPress Trac
noreply at wordpress.org
Thu Aug 28 10:22:26 UTC 2014
#29415: $sites global (containing all networks) no longer exists, with no
replacement
--------------------------------+-----------------------------
Reporter: rmccue | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: 3.9
Severity: normal | Keywords:
Focuses: multisite |
--------------------------------+-----------------------------
#27003 removed the `$sites` global containing an array of networks on the
installation. This broke the `switch_to_network` functionality of
[https://wordpress.org/plugins/wp-multi-network/ WP Multi Network], as it
expected this variable to be set.
Given that we've gone almost a whole release without anyone missing it, I
think it's fine to leave it gone forever. That said, there appears to be
no replacement to get all networks.
We should add a `wp_get_networks`, and it should also cache this result.
`wp_get_network` could then be adapted to take advantage of this cache if
it exists.
Related: #29411
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29415>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list