Make WordPress Core


Ignore:
Timestamp:
10/01/2012 06:03:23 PM (9 years ago)
Author:
ryan
Message:
  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/ms.php

    r21823 r22092  
    5656
    5757    $switch = false;
    58     if ( $blog_id != $wpdb->blogid ) {
     58    if ( get_current_blog_id() != $blog_id ) {
    5959        $switch = true;
    6060        switch_to_blog( $blog_id );
    61         $blog = get_blog_details( $blog_id );
    62     } else {
    63         $blog = $GLOBALS['current_blog'];
    64     }
     61    }
     62
     63    $blog = get_blog_details( $blog_id );
    6564
    6665    do_action( 'delete_blog', $blog_id, $drop );
     
    8281
    8382    if ( $drop ) {
    84 
    8583        $drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ) );
    8684
     
    123121            @rmdir( $dir );
    124122        }
     123
     124        clean_blog_cache( $blog );
    125125    }
    126126
Note: See TracChangeset for help on using the changeset viewer.