Use get_current_site() instead of the $current_site global when possible.

props jeremyfelt.
fixes #25158.
Built from https://develop.svn.wordpress.org/trunk@26120


git-svn-id: http://core.svn.wordpress.org/trunk@26032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2013-11-13 03:23:10 +00:00
parent fdc8f7dcff
commit 74f77b85a6
16 changed files with 54 additions and 58 deletions

View File

@@ -52,7 +52,7 @@ add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
* @return void
*/
function wpmu_delete_blog( $blog_id, $drop = false ) {
global $wpdb, $current_site;
global $wpdb;
$switch = false;
if ( get_current_blog_id() != $blog_id ) {
@@ -82,6 +82,8 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
update_blog_status( $blog_id, 'deleted', 1 );
$current_site = get_current_site();
// Don't destroy the initial, main, or root blog.
if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_site->path && $blog->domain == $current_site->domain ) ) )
$drop = false;