[wp-trac] [WordPress Trac] #40180: Introduce `get_site_by()` function for multisite
WordPress Trac
noreply at wordpress.org
Fri Sep 29 00:47:44 UTC 2017
#40180: Introduce `get_site_by()` function for multisite
-------------------------------------------------+-------------------------
Reporter: flixos90 | Owner: flixos90
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.9
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback has-unit- | Focuses: multisite
tests ms-roadmap needs-dev-note |
-------------------------------------------------+-------------------------
Comment (by jeremyfelt):
Thanks for all the work on this, @flixos90, it's looking good!
* I remember being a little wary of `url` as an argument, but it does seem
to fit pretty well.
* I'm a little unsure of the `domain` and `path` arguments as implemented.
We don't have the same `is_subdomain_install()` restrictions in
`get_sites()`. I would argue that if somebody is looking for protection
like that, they should adjust based on their awareness of the environment
rather than maybe go away thinking that a site doesn't exist. I may be
biased because in the current form, I would not be able to use
`get_site_by( 'domain' ... )` in my configuration.
* For the `slug` argument, I'm not sure we can assume that `path` will
always be `$network->path` when `is_subdomain_install()`. I would go the
other way and assume that we could leave `path` off entirely.
Everything else seems solid. I'll stare at the unit tests some more later
as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40180#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list