Multisite: Remove redundant `is_multisite()` checks in network admin templates.
`wp-admin/network/admin.php` is required by all of the individual network templates and begins with an `is_multisite()` check of its own. Because of this, we can remove the 26 other checks in the individual templates. Props flixos90. Fixes #37447. git-svn-id: https://develop.svn.wordpress.org/trunk@38657 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4799f61d23
commit
61f014b9fc
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/about.php' );
|
||||
|
|
|
@ -12,8 +12,10 @@ define( 'WP_NETWORK_ADMIN', true );
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
// Do not remove this check. It is required by individual network admin pages.
|
||||
if ( ! is_multisite() ) {
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
}
|
||||
|
||||
$redirect_network_admin_request = 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path );
|
||||
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/credits.php' );
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( empty( $_GET['action'] ) ) {
|
||||
wp_redirect( network_admin_url() );
|
||||
exit;
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/freedoms.php' );
|
||||
|
|
|
@ -13,9 +13,6 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
|
|||
/** Load WordPress dashboard API */
|
||||
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
|
||||
|
||||
if ( !is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_network' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/plugin-editor.php' );
|
||||
|
|
|
@ -13,7 +13,4 @@ if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/plugin-install.php' );
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/plugins.php' );
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/profile.php' );
|
||||
|
|
|
@ -13,9 +13,6 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
|
|||
/** WordPress Translation Install API */
|
||||
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_network_options' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/network.php' );
|
||||
|
|
|
@ -10,10 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() ) {
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( 'manage_sites' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
|
||||
}
|
||||
|
|
|
@ -13,9 +13,6 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
|
|||
/** WordPress Translation Install API */
|
||||
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_sites' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_sites' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_sites' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can('manage_sites') )
|
||||
wp_die(__('Sorry, you are not allowed to edit this site.'));
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_sites' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/theme-editor.php' );
|
||||
|
|
|
@ -13,7 +13,4 @@ if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/theme-install.php' );
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( !current_user_can('manage_network_themes') )
|
||||
wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
|
||||
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/update-core.php' );
|
||||
|
|
|
@ -13,7 +13,4 @@ if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'update-selec
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/update.php' );
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require_once( ABSPATH . WPINC . '/http.php' );
|
||||
|
||||
$title = __( 'Upgrade Network' );
|
||||
|
|
|
@ -10,7 +10,4 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
require( ABSPATH . 'wp-admin/user-edit.php' );
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can('create_users') )
|
||||
wp_die(__('Sorry, you are not allowed to add users to this network.'));
|
||||
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/** Load WordPress Administration Bootstrap */
|
||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||
|
||||
if ( ! is_multisite() )
|
||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
||||
|
||||
if ( ! current_user_can( 'manage_network_users' ) )
|
||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||
|
||||
|
|
Loading…
Reference in New Issue