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

WordPress Trac noreply at wordpress.org
Mon Sep 11 23:22:55 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 johnjamesjacoby):

 WP Multi Network has the following function names, which do exactly as
 they say:

 * `get_main_site_for_network()`
 * `is_main_site_for_network()`

 I prefer these over `get_main_site_id()` which, similar to
 `get_main_network_id()` insinuates that it's the single-one-and-only
 primary main omega site ID for the entire installation, not for any
 specific network. Put another way, it's the main site for the main
 network, and that's it. If you want the main site for a network, use the
 functions above.

 Probably not ironically, those functions in the WP Multi Network plugin
 are almost identical to the patches attached here. (There's only really so
 many ways to do this.) The major difference being that WPMN doesn't check
 the `SITE_ID_CURRENT_SITE` type globals here, because it really doesn't
 work very well to define those globals in a multi-network arrangement.

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


More information about the wp-trac mailing list