[wp-trac] [WordPress Trac] #40180: Introduce `get_site_by()` function for multisite
WordPress Trac
noreply at wordpress.org
Thu Sep 28 17:47:07 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 |
-------------------------------------------------+-------------------------
Changes (by flixos90):
* keywords: has-patch dev-feedback has-unit-tests ms-roadmap => has-patch
dev-feedback has-unit-tests ms-roadmap needs-dev-note
Comment:
[attachment:40180.4.diff] fixes two issues with the previous patch:
* If a domain starting with `www.` is given, the query is modified to be
sorted by `domain_length` in `DESC` order: If you provide a `www.` URL and
there actually is a `www.` and its variant without `www.` in the database,
you don't want the non-prefixed site to be returned. See
`get_blog_details()` where this currently happens to.
* Paths given are now correctly parsed. In the previous patch it was
possible for the path to end up as `//` which is invalid.
More tests have been added to verify the function works as expected.
This function is good to go in IMO, waiting for another review now. :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40180#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list