From ff140f1d7627eb346caf4cebea3169d07d4c5ab9 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 23 Apr 2010 16:18:33 +0000 Subject: [PATCH] Move ms_site_check() to after init and allow super admins to view blocked sites. see #13094 git-svn-id: http://svn.automattic.com/wordpress/trunk@14198 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-load.php | 9 +++++++++ wp-settings.php | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/wp-includes/ms-load.php b/wp-includes/ms-load.php index d9ae44d7a3..9eb3def343 100644 --- a/wp-includes/ms-load.php +++ b/wp-includes/ms-load.php @@ -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'; diff --git a/wp-settings.php b/wp-settings.php index 7468912608..9cea140dc9 100644 --- a/wp-settings.php +++ b/wp-settings.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. *