mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Multisite: Introduce a setup_network capability for setting up multisite.
`setup_network` is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to `manage_options` while in a multisite it falls back to `manage_network_options`. The introduction of this capability furthermore allows replacing an `is_super_admin()` check. Props ashokkumar24 for the original patch. Fixes #39206. See #37616. git-svn-id: https://develop.svn.wordpress.org/trunk@40390 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -15,7 +15,7 @@ define( 'WP_INSTALLING_NETWORK', true );
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_super_admin() ) {
|
||||
if ( ! current_user_can( 'setup_network' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user