[wp-trac] [WordPress Trac] #29415: $sites global (containing all networks) no longer exists, with no replacement

WordPress Trac noreply at wordpress.org
Wed Oct 29 00:05:29 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              |  Resolution:
 Keywords:                      |     Focuses:  multisite
--------------------------------+------------------------------

Comment (by ethitter):

 [attachment:29415.patch] is a basic start for `wp_get_networks()`.

 The function supports basic arguments--domain, path, limit, and offset--
 for which networks are to be retrieved. Like `wp_get_sites()`, the results
 from `$wpdb` are returned directly as an associative array.

 I consciously left caching out of this first pass; I'm not sure how
 beneficial it will be. On an instance with only a few networks, the cache
 lookup may not be any faster than the DB lookup. On a large network where
 there may be a benefit, storing all networks in a single array could
 encounter issues with cache value sizes.

 This needs tests as well, but I'm looking first for feedback on arguments
 and the need for caching. Without any use cases in Core currently, it's
 hard to anticipate deficiencies in my initial approach.

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


More information about the wp-trac mailing list