Move ms_site_check() to after init and allow super admins to view blocked sites. see #13094
git-svn-id: https://develop.svn.wordpress.org/trunk@14198 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4f6c6647f3
commit
353adc8969
@ -38,6 +38,15 @@ function is_subdomain_install() {
|
||||
function ms_site_check() {
|
||||
global $wpdb, $current_blog;
|
||||
|
||||
// Allow short-circuiting
|
||||
$check = apply_filters('ms_site_check', null);
|
||||
if ( null !== $check )
|
||||
return;
|
||||
|
||||
// Allow super admins to see blocked sites
|
||||
if ( is_super_admin() )
|
||||
return true;
|
||||
|
||||
if ( '1' == $current_blog->deleted ) {
|
||||
if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
|
||||
return WP_CONTENT_DIR . '/blog-deleted.php';
|
||||
|
@ -153,16 +153,8 @@ unset( $mu_plugin );
|
||||
|
||||
do_action( 'muplugins_loaded' );
|
||||
|
||||
// Check site status if multisite.
|
||||
if ( is_multisite() ) {
|
||||
if ( true !== ( $file = ms_site_check() ) ) {
|
||||
require( $file );
|
||||
die();
|
||||
}
|
||||
unset($file);
|
||||
|
||||
if ( is_multisite() )
|
||||
ms_cookie_constants( );
|
||||
}
|
||||
|
||||
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
||||
wp_cookie_constants( );
|
||||
@ -290,6 +282,15 @@ $wp->init();
|
||||
*/
|
||||
do_action( 'init' );
|
||||
|
||||
// Check site status
|
||||
if ( is_multisite() ) {
|
||||
if ( true !== ( $file = ms_site_check() ) ) {
|
||||
require( $file );
|
||||
die();
|
||||
}
|
||||
unset($file);
|
||||
}
|
||||
|
||||
/**
|
||||
* This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user