[wp-trac] [WordPress Trac] #29684: Add get_main_site_id() function
WordPress Trac
noreply at wordpress.org
Wed Aug 30 20:39:09 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 jeremyfelt):
Replying to [comment:28 flixos90]:
> [attachment:29684.10.diff] changes the following:
> * Rename the filter to `pre_get_main_site_id()` and adjust the docs
accordingly to indicate it's a short-circuiting filter.
+1
> * Remove two tests (including the failing one) that actually weren't
really useful for testing the function since they actually would need to
rely on network switching to have a purpose (which we don't have in core).
These tests are both real world conditions that I'd expect the function as
written to handle. One returns data as expected, one highlights an area of
confusion if we don't address it.
I have a feeling that `get_site()` will work (by providing the site's
network ID) and that there's an unrelated issue in another test that's
causing cross-pollution.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29684#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list