[wp-trac] [WordPress Trac] #30175: In multisite, on a site with only subscribers, wp_dropdown_users returns empty string
WordPress Trac
noreply at wordpress.org
Wed Oct 29 17:49:15 UTC 2014
#30175: In multisite, on a site with only subscribers, wp_dropdown_users returns
empty string
-----------------------------+------------------------------
Reporter: johnjamesjacoby | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Users | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-----------------------------+------------------------------
Changes (by johnjamesjacoby):
* keywords: needs-patch => has-patch
Comment:
The proposed patch is admittedly not super great, but I think it's an
acceptable approach.
If no users on the current site are capable of being listed in the
dropdown, (I think) we can safely assume any super administrators are. The
attached patch:
* Checks if the call to `get_users()` returned no results
* Checks if `is_multisite()`
* Checks if the current logged in user `is_super_admin` (as only super
admins should be able to assign other super admins.)
* Queries for super admins using an approach similar to what's already in:
`WP_MS_Users_List_Table->prepare_items()`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30175#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list