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

WordPress Trac noreply at wordpress.org
Fri Sep 8 17:34:41 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):

 [https://core.trac.wordpress.org/attachment/ticket/29684/29684.16.diff
 29684.16.diff] - Feels extremely limiting and half a solution. This is
 patch, it really does feel like we are pulling at threads, as every time
 we think have it, something else comes up.

 We now have two options, either a limited patch in the form of
 29684.16.diff or wider reacting patch of 29684.17.diff. 29684.17.diff an
 fixes an issue for me, as the site_id is not automatically setup when
 referencing a different network. I don't like having a class level
 property that I can't trust that exists. It makes it useless to me. The
 magic getting forces it be set. This will likely fixes issues with multi
 network setups that we don't even know exist.

 In work in the networks endpoint I list networks. Without the magic logic,
 all but the current network have site id set to 0. Even if I do this
 {{{#!php
 get_network(1)->site_id
 }}}
 it will return 0. This really fixes broken and is confusing that to other
 developer that don't understand the history of this.

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


More information about the wp-trac mailing list