Introduce filter, 'wp_multisite_sso_pre_get_network_sites' #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for the useful plugin!
In the
get_network_sites()
method, by default, it fetches all sites and active mapped domains.For our site's needs, we don't need to fetch all sites since most of our sites are subdomains, so logging in from the main site handles 90% of our needs here. Related: #26.
Secondly, we have many mapped domains, so the default behavior to login to each mapped domain isn't useful to us. Also, not all mapped domains are
active
or in WPMU Domain Mapping terms,primary
.In this PR, I've introduced a new filter,
'wp_multisite_sso_pre_get_network_sites'
, to allow developers to do their own site lookup routine to bypass the default network site lookup.If you're interested to see how we're using this filter, let me know and I can pass on what we're using. We basically are using this filter to address #6.