Role/Capability: Don't assign the delete_site
capability to anyone on single site installs.
This capability is not relevant on single site installs; it only applies to deleting a site on a multisite installation. Fixes #38326 git-svn-id: https://develop.svn.wordpress.org/trunk@39494 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8948847eb1
commit
7c02c24e5f
@ -422,7 +422,11 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
$caps[] = 'edit_theme_options';
|
||||
break;
|
||||
case 'delete_site':
|
||||
$caps[] = 'manage_options';
|
||||
if ( is_multisite() ) {
|
||||
$caps[] = 'manage_options';
|
||||
} else {
|
||||
$caps[] = 'do_not_allow';
|
||||
}
|
||||
break;
|
||||
case 'edit_term':
|
||||
case 'delete_term':
|
||||
|
@ -225,11 +225,11 @@ class Tests_User_Capabilities extends WP_UnitTestCase {
|
||||
'manage_network_plugins' => array(),
|
||||
'manage_network_themes' => array(),
|
||||
'manage_network_options' => array(),
|
||||
'delete_site' => array(),
|
||||
|
||||
'upload_plugins' => array( 'administrator' ),
|
||||
'upload_themes' => array( 'administrator' ),
|
||||
'customize' => array( 'administrator' ),
|
||||
'delete_site' => array( 'administrator' ),
|
||||
'add_users' => array( 'administrator' ),
|
||||
|
||||
'edit_categories' => array( 'administrator', 'editor' ),
|
||||
|
Loading…
Reference in New Issue
Block a user