Skip to:
Content

BuddyPress.org

Changeset 8600


Ignore:
Timestamp:
07/11/2014 09:32:44 PM (10 years ago)
Author:
johnjamesjacoby
Message:

In bp_blogs_add_user_to_blog0 call switch_to_blog() before running role comparisons to ensure roles for that blog are reinitialized correctly. See #5749.

File:
1 edited

Legend:

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

    r8599 r8600  
    786786        if ( ! empty( $user_roles ) ) {
    787787
     788            // Switch to this blog so roles are re-init'ed
     789            switch_to_blog( $blog_id );
     790
    788791            // Look for blog only roles
    789792            $blog_roles = array_intersect(
     
    791794                array_keys( get_editable_roles() )
    792795            );
     796
     797            // Come back to the current blog
     798            restore_current_blog();
    793799
    794800            // If there's a role in the array, use the first one. This isn't
Note: See TracChangeset for help on using the changeset viewer.