Opened 13 years ago
Closed 13 years ago
#17829 closed defect (bug) (fixed)
Site Admin goes to User Admin if user has no sites
Reported by: | trepmal | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Network Admin | Keywords: | has-patch commit |
Focuses: | multisite | Cc: |
Description
If a Super Admin is not specifically added as a user to any site, the Site Admin link in the Howdy dropdown goes to the User Admin.
It looks like this has been happening since 3.1.
the patch adds a check to see if the current user has any sites. If the user doesn't have any sites, the link's title and text are changed to User Admin.
Attachments (7)
Change History (15)
#1
@
13 years ago
- Component changed from General to Network Admin
- Milestone changed from Awaiting Review to 3.2
- Version changed from 3.2 to 3.1
#2
@
13 years ago
- Owner set to nacin
- Status changed from new to accepted
A note, I think we call it Global Dashboard, rather than User Admin, but I'd have to check.
To improve the patch, try setting $label to your translated string. Then just build the link with the variable, escaping in the attribute with esc_attr.
#3
@
13 years ago
- Keywords commit added
We need a better function than get_blogs_of_user() that provides us boolean values as to whether someone has a blog. Without object caching that function really stinks cause it runs a lot of cross-blog queries.
Regardless, that patch looks good for 3.2. Would rather it be prettied a little -- if were are to do else { }
when we also need to do brackets around the first if statement.
Likewise $links[10]
needs an extra indent and the empty lines after the else
and before the $links[10]
assignment aren't really needed.
#4
@
13 years ago
Another approach is to fix get_dashboard_url(). wp-login.php also needs a tweak to deal with this scenario.
#5
@
13 years ago
I think fixing get_dashboard_url() may be a better approach. I was wondering why we might want to send super admins to the user admin. Answer to me seems never.
#6
@
13 years ago
First patch solved the login, but not the link in the admin header. get_dashboard_url() would return wp-admin/user for supes, and I think we can agree that if the supes have no blogs, it should go to the main site (admin_url()).
Second patch handles this by properly forcing the code to skip one branch and end up in the else.
Moving to 3.2 milestone for consideration.
Code could be made less repetitive.