mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
* Register blog-id-cache group as global
* Introduce clean_blog_cache() so we can run it independently of refresh_blog_details() which assumes the blog still exists and get_blog_details() can be called. * Don't db escape cache keys in get_blog_id_from_url() * prepare() the query in get_blog_id_from_url() * Return 0 for all failures in get_blog_id_from_url() * clean_blog_cache() after dropping tables in wpmu_delete_blog() to make sure the cache is for real cleaned. git-svn-id: https://develop.svn.wordpress.org/trunk@22092 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -55,14 +55,13 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
||||
global $wpdb, $current_site;
|
||||
|
||||
$switch = false;
|
||||
if ( $blog_id != $wpdb->blogid ) {
|
||||
if ( get_current_blog_id() != $blog_id ) {
|
||||
$switch = true;
|
||||
switch_to_blog( $blog_id );
|
||||
$blog = get_blog_details( $blog_id );
|
||||
} else {
|
||||
$blog = $GLOBALS['current_blog'];
|
||||
}
|
||||
|
||||
$blog = get_blog_details( $blog_id );
|
||||
|
||||
do_action( 'delete_blog', $blog_id, $drop );
|
||||
|
||||
$users = get_users( array( 'blog_id' => $blog_id, 'fields' => 'ids' ) );
|
||||
@@ -81,7 +80,6 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
||||
$drop = false;
|
||||
|
||||
if ( $drop ) {
|
||||
|
||||
$drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ) );
|
||||
|
||||
foreach ( (array) $drop_tables as $table ) {
|
||||
@@ -122,6 +120,8 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
||||
if ( $dir != $top_dir)
|
||||
@rmdir( $dir );
|
||||
}
|
||||
|
||||
clean_blog_cache( $blog );
|
||||
}
|
||||
|
||||
if ( $switch )
|
||||
|
||||
Reference in New Issue
Block a user