[wp-trac] [WordPress Trac] #37218: get_main_network_id should use WP_Network_Query

WordPress Trac noreply at wordpress.org
Sat Sep 3 00:07:01 UTC 2016


#37218: get_main_network_id should use WP_Network_Query
--------------------------------+-------------------------
 Reporter:  spacedmonkey        |       Owner:  jeremyfelt
     Type:  enhancement         |      Status:  reviewing
 Priority:  normal              |   Milestone:  4.7
Component:  Networks and Sites  |     Version:  4.6
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+-------------------------
Changes (by jeremyfelt):

 * owner:   => jeremyfelt
 * status:  new => reviewing


Comment:

 Replying to [comment:2 flixos90]:
 > One thing I don't think we need is the `! empty( $_networks )` check.
 That kind of check hasn't been in place before and shouldn't be required
 since every Multisite has at least one network.

 Agreed. I don't believe there's a way to hit that condition unless
 something has gone very wrong. I think we're okay without it. I've added
 [attachment:37218.4.diff], which makes that change.

 > About unit tests, I don't think these are necessary here since that part
 of `get_main_network_id()` is already covered
 (https://core.trac.wordpress.org/browser/trunk/tests/phpunit/tests/multisite/network.php#L66
 would fail if we broke it).

 +1

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


More information about the wp-trac mailing list