#30470 closed enhancement (fixed)
Introduce "delete_blog" capability
Reported by: | thomaswm | Owned by: | jeremyfelt |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | has-patch needs-testing |
Focuses: | multisite | Cc: |
Description
Currently, any user with administrator privileges for one blog within a multisite network can delete this specific blog. While the creation of new blogs can be restricted to network admins in the network options, there is no such option for the deletion of blogs.
When I dug into the code of wp-admin/ms-delete-site.php
, I stumbled upon the following comment in line 15:
// @todo Create a delete blog cap. if ( ! current_user_can( 'manage_options' ) ) wp_die(__( 'You do not have sufficient permissions to delete this site.'));
I'd suggest to introduce such a capability. Then it would be possible to control who is able to delete a blog within the multisite network.
Attachments (2)
Change History (8)
#2
in reply to:
↑ 1
@
10 years ago
Replying to jeremyfelt:
We could map
delete_site
tomanage_options
inmap_meta_cap()
This is what we usually do whenever more granular capabilities are introduced.
Note: See
TracTickets for help on using
tickets.
Thanks for the ticket, @thomaswm!
This is a tough one. I completely agree that a
delete_blog
(or reallydelete_site
) capability should be available. However, sincemanage_options
has been used for years, we can't necessarily swap the two out. I'm not sure how likely it is that custom requirements would removemanage_options
from the administrator role, but it's possible. It's probably more likely thatmanage_options
has been added to a custom set of users in some cases.We could map
delete_site
tomanage_options
inmap_meta_cap()
... possibly the safest bet as this would default to everyone withmanage_options
capabilities.Ideas welcome. :)