Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/11/2011 06:02:47 PM (14 years ago)
Author:
boonebgorges
Message:

Audit of the use of ->blog_id to change to ->blogid where possible, to better account for switch_to_blog() use. Fixes #2984. Props wpmuguru

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-functions.php

    r3940 r4107  
    265265
    266266function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
    267     global $wpdb, $current_blog;
    268 
    269     if ( empty( $blog_id ) && isset( $current_blog ) )
    270         $blog_id = $current_blog->blog_id;
     267    global $wpdb;
     268
     269    if ( empty( $blog_id ) && isset( $wpdb->blogid ) )
     270        $blog_id = $wpdb->blogid;
    271271    else
    272272        $blog_id = BP_ROOT_BLOG;
     
    291291
    292292function bp_blogs_remove_user_from_blog( $user_id, $blog_id = 0 ) {
    293     global $current_blog;
     293    global $wpdb;
    294294
    295295    if ( empty( $blog_id ) )
    296         $blog_id = $current_blog->blog_id;
     296        $blog_id = $wpdb->blogid;
    297297
    298298    bp_blogs_remove_blog_for_user( $user_id, $blog_id );
     
    330330
    331331function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
    332     global $current_blog, $bp;
    333 
    334     if ( empty( $current_blog->blog_id ) )
     332    global $wpdb, $bp;
     333
     334    if ( empty( $wpdb->blogid ) )
    335335        return false;
    336336
     
    338338
    339339    if ( !$blog_id )
    340         $blog_id = (int)$current_blog->blog_id;
     340        $blog_id = (int)$wpdb->blogid;
    341341
    342342    if ( !$user_id )
Note: See TracChangeset for help on using the changeset viewer.