Skip to content

Commit 61f014b

Browse files
committed
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
1 parent 4799f61 commit 61f014b

27 files changed

Lines changed: 3 additions & 80 deletions

src/wp-admin/network/about.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
require( ABSPATH . 'wp-admin/about.php' );

src/wp-admin/network/admin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
/** Load WordPress Administration Bootstrap */
1313
require_once( dirname( dirname( __FILE__ ) ) . '/admin.php' );
1414

15-
if ( ! is_multisite() )
15+
// Do not remove this check. It is required by individual network admin pages.
16+
if ( ! is_multisite() ) {
1617
wp_die( __( 'Multisite support is not enabled.' ) );
18+
}
1719

1820
$redirect_network_admin_request = 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path );
1921

src/wp-admin/network/credits.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
require( ABSPATH . 'wp-admin/credits.php' );

src/wp-admin/network/edit.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
if ( empty( $_GET['action'] ) ) {
1714
wp_redirect( network_admin_url() );
1815
exit;

src/wp-admin/network/freedoms.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
require( ABSPATH . 'wp-admin/freedoms.php' );

src/wp-admin/network/index.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
/** Load WordPress dashboard API */
1414
require_once( ABSPATH . 'wp-admin/includes/dashboard.php' );
1515

16-
if ( !is_multisite() )
17-
wp_die( __( 'Multisite support is not enabled.' ) );
18-
1916
if ( ! current_user_can( 'manage_network' ) )
2017
wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
2118

src/wp-admin/network/plugin-editor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
require( ABSPATH . 'wp-admin/plugin-editor.php' );

src/wp-admin/network/plugin-install.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,4 @@
1313
/** Load WordPress Administration Bootstrap */
1414
require_once( dirname( __FILE__ ) . '/admin.php' );
1515

16-
if ( ! is_multisite() )
17-
wp_die( __( 'Multisite support is not enabled.' ) );
18-
1916
require( ABSPATH . 'wp-admin/plugin-install.php' );

src/wp-admin/network/plugins.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
require( ABSPATH . 'wp-admin/plugins.php' );

src/wp-admin/network/profile.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@
1010
/** Load WordPress Administration Bootstrap */
1111
require_once( dirname( __FILE__ ) . '/admin.php' );
1212

13-
if ( ! is_multisite() )
14-
wp_die( __( 'Multisite support is not enabled.' ) );
15-
1613
require( ABSPATH . 'wp-admin/profile.php' );

0 commit comments

Comments
 (0)