[wp-trac] [WordPress Trac] #33900: introduce get_current_network_id helper function

WordPress Trac noreply at wordpress.org
Sat Apr 16 19:58:51 UTC 2016


#33900: introduce get_current_network_id helper function
--------------------------------+------------------------
 Reporter:  spacedmonkey        |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  4.6
Component:  Networks and Sites  |     Version:  4.4
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+------------------------

Comment (by jeremyfelt):

 In single site, `get_current_blog_id()` will return `1` because the global
 `$blog_id` is setup in `wp_initial_constants()`. We don't do anything
 similar for a global network ID, though in `get_main_network_id()` we
 return `1` if not multisite.

 So I guess my question is, does this logic make sense:

 * If `! is_multisite()`, return `1`.
 * If `is_multisite()` and not a `WP_Network` instance, return 1.
 * If `is_multisite()` and a `WP_Network` instance, return ID.

 What would lead to the second condition?

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


More information about the wp-trac mailing list