[wp-trac] [WordPress Trac] #29684: Add get_main_site_id() function

WordPress Trac noreply at wordpress.org
Mon Aug 28 20:09:13 UTC 2017


#29684: Add get_main_site_id() function
--------------------------------------+-------------------------
 Reporter:  rmccue                    |       Owner:  jeremyfelt
     Type:  enhancement               |      Status:  reviewing
 Priority:  normal                    |   Milestone:  4.9
Component:  Networks and Sites        |     Version:  3.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+-------------------------

Comment (by jeremyfelt):

 We discussed this ticket during bug scrub quite a bit today. In the first
 iteration we're going to plan on sticking close to what's being pulled
 from the current bootstrap and not introduce a new network option. Once
 this is in, and possibly once network meta is available, we may be able to
 adjust.

 I've created a new tests file `getMainSiteId.php` in
 [attachment:29684.7.diff] that uses a common factory for the networks and
 sites and separates these tests from the standard site tests.

 There is one failing test - When using `get_main_site_id()` without
 specifying the network when switched to a site that is not on the current
 network, the current network is used rather than the switched site's
 network.

 I tried using `get_site()` to retrieve the network ID in this case, but
 other unit tests blew up. There's a good chance I was missing something
 simple, but I'm going to upload the patch with the failing test as is.

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


More information about the wp-trac mailing list