-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For non-super-admins, use get_blogs_of_user() to determine authroized sites. #1179
base: develop
Are you sure you want to change the base?
Conversation
@peterwilsoncc Tested and ensured that the PR is working for me. |
@peterwilsoncc It seems that the 1000 site limit problem will still be there for super admins, so why not query for number of sites like this and store it in transients instead of passing a static number:
|
Thanks for looking at this @kirtangajjar. The limit of 1000 sites was added in 3077cf9. Based on the commit message it was a coding standards fix to avoid a warning for an unlimited query. I'd be surprised if many users were hitting the 1000 site limit but do you think it's worth adding a filter to allow developers to increase the size of the dropdown? |
Fwiw filtering for that seems like a good handling to me. |
Description of the Change
Modifies the query used to determine a user's authorized sites to use
get_blogs_of_user()
.As super admins have access to all sites without being a member, the existing
get_sites()
query is used for super admins.Closes #1176
How to test the Change
export XDEBUG_MODE=off; for i in {1..1050}; do wp site create --slug=$i --title="MS $i" --url=https://ms-distributor.local; done;
(change the URL if needs be)Creating the sites may take some time so you should leave the command going and switch tasks for a while.
Changelog Entry
Credits
Props @jeffpaul, @boonebgorges, @peterwilsoncc.
Checklist: