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
This commit is contained in:
parent
9a92811b38
commit
ff140f1d76
|
@ -38,6 +38,15 @@ function is_subdomain_install() {
|
||||||
function ms_site_check() {
|
function ms_site_check() {
|
||||||
global $wpdb, $current_blog;
|
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 ( '1' == $current_blog->deleted ) {
|
||||||
if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
|
if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
|
||||||
return WP_CONTENT_DIR . '/blog-deleted.php';
|
return WP_CONTENT_DIR . '/blog-deleted.php';
|
||||||
|
|
|
@ -153,16 +153,8 @@ unset( $mu_plugin );
|
||||||
|
|
||||||
do_action( 'muplugins_loaded' );
|
do_action( 'muplugins_loaded' );
|
||||||
|
|
||||||
// Check site status if multisite.
|
if ( is_multisite() )
|
||||||
if ( is_multisite() ) {
|
|
||||||
if ( true !== ( $file = ms_site_check() ) ) {
|
|
||||||
require( $file );
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
unset($file);
|
|
||||||
|
|
||||||
ms_cookie_constants( );
|
ms_cookie_constants( );
|
||||||
}
|
|
||||||
|
|
||||||
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
// Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
|
||||||
wp_cookie_constants( );
|
wp_cookie_constants( );
|
||||||
|
@ -290,6 +282,15 @@ $wp->init();
|
||||||
*/
|
*/
|
||||||
do_action( '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.
|
* This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue