For non-super-admins, use get_blogs_of_user() to determine authroized sites.#1179
Merged
Conversation
Closed
1 task
peterwilsoncc
marked this pull request as ready for review
January 16, 2024 01:32
peterwilsoncc
requested review from
Sidsector9
and removed request for
a team
January 16, 2024 01:32
Contributor
|
@peterwilsoncc Tested and ensured that the PR is working for me. |
Contributor
|
@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: |
Collaborator
Author
|
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? |
Member
|
Fwiw filtering for that seems like a good handling to me. |
|
@Sidsector9 checking if you can help with the review here? |
jeffpaul
requested review from
dkotter
and removed request for
Sidsector9 and
iamdharmesh
January 13, 2026 14:23
dkotter
reviewed
Jan 13, 2026
dkotter
approved these changes
Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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: