[wp-trac] [WordPress Trac] #32504: WP_Network_Query class

WordPress Trac noreply at wordpress.org
Thu Apr 28 23:46:14 UTC 2016


#32504: WP_Network_Query class
--------------------------------+-----------------------------
 Reporter:  jeremyfelt          |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Future Release
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+-----------------------------
Changes (by flixos90):

 * keywords:  needs-patch => has-patch


Comment:

 [attachment:32504.diff] is an initial take on `WP_Network_Query`. I took
 an approach similar to the other recent query classes where only the ID is
 queried. These IDs are then (if necessary) transformed into objects
 through a new `get_network()` function. I also added related method to
 prime the network cache. Network meta (also known as network options or
 site options, stored in the sitemeta table) is also supported.

 This is just a first patch that definitely needs to be enhanced and
 extended. Specifically I think it would be great to directly support a
 `super_admin` parameter which the class will automatically handle and
 transform it into a meta query for it. There are other use-cases as well,
 specifically I'm taking the use-cases from the WP Multi Network plugin
 into account.

 The patch also introduces a new function `get_networks()` which makes use
 of `WP_Network_Query`, so this is a good way to test it.

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


More information about the wp-trac mailing list