Skip to:
Content

BuddyPress.org

Changeset 5338


Ignore:
Timestamp:
11/20/2011 12:30:52 AM (10 years ago)
Author:
boonebgorges
Message:

Don't fall back on root_blog when blog_id is passed to bp_blogs_add_user_to_blog(). Fixes #3755

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-blogs/bp-blogs-functions.php

    r5247 r5338  
    299299function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
    300300    global $wpdb;
    301 
    302     if ( empty( $blog_id ) && isset( $wpdb->blogid ) )
    303         $blog_id = $wpdb->blogid;
    304     else
    305         $blog_id = bp_get_root_blog_id();
     301   
     302    if ( empty( $blog_id ) ) {
     303        $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
     304    }
    306305
    307306    if ( empty( $role ) ) {
     
    315314            return false;
    316315    }
     316   
     317   
    317318
    318319    if ( $role != 'subscriber' )
Note: See TracChangeset for help on using the changeset viewer.