Opened 10 years ago
Last modified 3 weeks ago
#30175 assigned defect (bug)
In multisite, on a site with only subscribers, wp_dropdown_users returns empty string
Reported by: | johnjamesjacoby | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Users | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
This becomes a problem when editing posts on sites with no capable users. Technically, an empty string is the expected result, as the site has no users with adequate capabilities to assign as the author of a post. (I'll propose 1 solution in a comment below.)
To duplicate:
- Setup multisite
- Create a second site
- Add a user to it as a Subscriber
- Remove yourself from that site, if necessary
- Edit the "Hello World" post
- Notice the "Author" metabox is empty
Attachments (1)
Change History (6)
This ticket was mentioned in Slack in #core-multisite by richardtape. View the logs.
8 years ago
Note: See
TracTickets for help on using
tickets.
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:
get_users()
returned no resultsis_multisite()
is_super_admin
(as only super admins should be able to assign other super admins.)WP_MS_Users_List_Table->prepare_items()