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

WordPress Trac noreply at wordpress.org
Thu Aug 31 11:14:58 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 ms-roadmap  |     Focuses:  multisite
-------------------------------------------------+-------------------------

Comment (by spacedmonkey):

 99% of the time (even in a multi network setup) that this function will be
 called, network_id will be passed as null. Meaning you are really
 referencing $current_site, setup in the bootstrap. In all my setups, the
 $current_site is setup in the sunrise file. We should be reference the
 class property here, not the function. Get main site id should only ever
 be called as failsafe if that property isn't set.

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


More information about the wp-trac mailing list