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

WordPress Trac noreply at wordpress.org
Tue Aug 30 14:14:29 UTC 2016


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

 * keywords:  has-patch needs-unit-tests => has-patch
 * milestone:  Awaiting Review => 4.7


Comment:

 Patch looks good to me. +1 for getting rid of the cache key. 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.

 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).

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


More information about the wp-trac mailing list