Skip to:
Content

BuddyPress.org

Changeset 5337


Ignore:
Timestamp:
11/20/2011 12:30:12 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
  • trunk/bp-blogs/bp-blogs-functions.php

    r5328 r5337  
    291291function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) {
    292292    global $wpdb;
    293 
    294     if ( empty( $blog_id ) && isset( $wpdb->blogid ) )
    295         $blog_id = $wpdb->blogid;
    296     else
    297         $blog_id = bp_get_root_blog_id();
     293   
     294    if ( empty( $blog_id ) ) {
     295        $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id();
     296    }
    298297
    299298    if ( empty( $role ) ) {
     
    307306            return false;
    308307    }
     308   
     309   
    309310
    310311    if ( $role != 'subscriber' )
Note: See TracChangeset for help on using the changeset viewer.