Opened 12 years ago
Closed 9 years ago
#21788 closed enhancement (fixed)
Relocate revoke_super_admin() and grant_super_admin() to capabilities.php
Reported by: | johnjamesjacoby | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Role/Capability | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description
Would be nice to move revoke_super_admin() and grant_super_admin() out of /wp-admin/includes/ms.php and into to /wp-includes/capabilities.php, where the rest of the _super_admin() functions are.
This allows theme-side user profile plugins (see: the bb's) to use these functions without needing to pull in a wp-admin file directly.
Attachments (2)
Change History (17)
#2
@
12 years ago
Same with:
- update_user_status()
- refresh_user_details() (not used anywhere in core.)
- upload_is_user_over_quota() (Would prevent function exists check in class-wp-importer.php.)
#3
@
10 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.1
Bumping to 4.1 to be reconsidered in conjunction with other multisite code changes.
#4
follow-up:
↓ 5
@
10 years ago
- Milestone changed from 4.1 to Future Release
It's a bit late to move some code around, should be done early in a cycle.
#5
in reply to:
↑ 4
;
follow-up:
↓ 7
@
10 years ago
Replying to ocean90:
It's a bit late to move some code around, should be done early in a cycle.
This was opened 6 releases ago, and moved 4 weeks ago (2 weeks before beta.)
What's the sweet spot to get this done without being noisy about it?
#7
in reply to:
↑ 5
;
follow-up:
↓ 9
@
9 years ago
- Milestone changed from Future Release to 4.5
We can get this one in early. :)
#9
in reply to:
↑ 7
@
9 years ago
- Focuses multisite added
- Keywords 4.6-early added; early removed
- Milestone changed from 4.5 to Future Release
Replying to jeremyfelt:
We can get this one in early. :)
My bad. :(
4.6 it is and I'm adding early to it / writing it on my board. :)
This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.
9 years ago
#11
@
9 years ago
- Keywords has-patch added; needs-patch removed
- Type changed from defect (bug) to enhancement
21788.diff is a refresh against current trunk. It also adds an is_multisite()
check to immediately bail if used for single site.
#12
follow-up:
↓ 13
@
9 years ago
Nice! Interesting catch with the is_multisite()
additions.
These functions conveniently use the _site_option()
functions, which technically do work on single-site, so I don't know that adding is_multisite()
is necessary necessary, but I suppose probably wise.
Patch applies cleanly.
#13
in reply to:
↑ 12
@
9 years ago
Replying to johnjamesjacoby:
These functions conveniently use the
_site_option()
functions, which technically do work on single-site, so I don't know that addingis_multisite()
is necessary necessary, but I suppose probably wise.
Yeah, it seems like a good idea to move the functions first before thinking about whether support for grant/revoke should be added to single site.
Should probably be moved to ms-functions.php, or be made non-multisite aware (in which case they wouldn't do anything). I'm okay with this but it was nice to have these in the admin only, I guess to avoid people shooting themselves in the foot. wp_delete_user() and wpmu_delete_user() are similarly in the admin.