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. Built from https://develop.svn.wordpress.org/trunk@38657 git-svn-id: http://core.svn.wordpress.org/trunk@38600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
03dd15bf7f
commit
3d19ab1ce2
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/about.php' );
|
require( ABSPATH . 'wp-admin/about.php' );
|
||||||
|
|
|
@ -12,8 +12,10 @@ define( 'WP_NETWORK_ADMIN', true );
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
|
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.' ) );
|
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 );
|
$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 */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/credits.php' );
|
require( ABSPATH . 'wp-admin/credits.php' );
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( empty( $_GET['action'] ) ) {
|
if ( empty( $_GET['action'] ) ) {
|
||||||
wp_redirect( network_admin_url() );
|
wp_redirect( network_admin_url() );
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/freedoms.php' );
|
require( ABSPATH . 'wp-admin/freedoms.php' );
|
||||||
|
|
|
@ -13,9 +13,6 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
/** Load WordPress dashboard API */
|
/** Load WordPress dashboard API */
|
||||||
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
|
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
|
||||||
|
|
||||||
if ( !is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_network' ) )
|
if ( ! current_user_can( 'manage_network' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/plugin-editor.php' );
|
require( ABSPATH . 'wp-admin/plugin-editor.php' );
|
||||||
|
|
|
@ -13,7 +13,4 @@ if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) )
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/plugin-install.php' );
|
require( ABSPATH . 'wp-admin/plugin-install.php' );
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/plugins.php' );
|
require( ABSPATH . 'wp-admin/plugins.php' );
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/profile.php' );
|
require( ABSPATH . 'wp-admin/profile.php' );
|
||||||
|
|
|
@ -13,9 +13,6 @@ require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
/** WordPress Translation Install API */
|
/** WordPress Translation Install API */
|
||||||
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
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' ) )
|
if ( ! current_user_can( 'manage_network_options' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/network.php' );
|
require( ABSPATH . 'wp-admin/network.php' );
|
||||||
|
|
|
@ -10,10 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() ) {
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_sites' ) ) {
|
if ( ! current_user_can( 'manage_sites' ) ) {
|
||||||
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
|
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 */
|
/** WordPress Translation Install API */
|
||||||
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
|
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' ) )
|
if ( ! current_user_can( 'manage_sites' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
|
wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_sites' ) )
|
if ( ! current_user_can( 'manage_sites' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
|
wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_sites' ) )
|
if ( ! current_user_can( 'manage_sites' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );
|
wp_die( __( 'Sorry, you are not allowed to manage themes for this site.' ) );
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can('manage_sites') )
|
if ( ! current_user_can('manage_sites') )
|
||||||
wp_die(__('Sorry, you are not allowed to edit this site.'));
|
wp_die(__('Sorry, you are not allowed to edit this site.'));
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_sites' ) )
|
if ( ! current_user_can( 'manage_sites' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/theme-editor.php' );
|
require( ABSPATH . 'wp-admin/theme-editor.php' );
|
||||||
|
|
|
@ -13,7 +13,4 @@ if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) )
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/theme-install.php' );
|
require( ABSPATH . 'wp-admin/theme-install.php' );
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( !current_user_can('manage_network_themes') )
|
if ( !current_user_can('manage_network_themes') )
|
||||||
wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
|
wp_die( __( 'Sorry, you are not allowed to manage network themes.' ) );
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/update-core.php' );
|
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 */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/update.php' );
|
require( ABSPATH . 'wp-admin/update.php' );
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require_once( ABSPATH . WPINC . '/http.php' );
|
require_once( ABSPATH . WPINC . '/http.php' );
|
||||||
|
|
||||||
$title = __( 'Upgrade Network' );
|
$title = __( 'Upgrade Network' );
|
||||||
|
|
|
@ -10,7 +10,4 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
require( ABSPATH . 'wp-admin/user-edit.php' );
|
require( ABSPATH . 'wp-admin/user-edit.php' );
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can('create_users') )
|
if ( ! current_user_can('create_users') )
|
||||||
wp_die(__('Sorry, you are not allowed to add users to this network.'));
|
wp_die(__('Sorry, you are not allowed to add users to this network.'));
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
/** Load WordPress Administration Bootstrap */
|
/** Load WordPress Administration Bootstrap */
|
||||||
require_once( dirname( __FILE__ ) . '/admin.php' );
|
require_once( dirname( __FILE__ ) . '/admin.php' );
|
||||||
|
|
||||||
if ( ! is_multisite() )
|
|
||||||
wp_die( __( 'Multisite support is not enabled.' ) );
|
|
||||||
|
|
||||||
if ( ! current_user_can( 'manage_network_users' ) )
|
if ( ! current_user_can( 'manage_network_users' ) )
|
||||||
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38656';
|
$wp_version = '4.7-alpha-38657';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue