Skip to:
Content

BuddyPress.org

Changeset 10872


Ignore:
Timestamp:
06/02/2016 04:59:49 PM (3 years ago)
Author:
boonebgorges
Message:

Use bp_get_taxonomy_term_site_id() when switching to generate tax queries for member and group types.

Props Offereins.
See #7077.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-user-query.php

    r10425 r10872  
    789789
    790790        // Switch to the root blog, where member type taxonomies live.
     791        $site_id  = bp_get_taxonomy_term_site_id( 'bp_member_type' );
    791792        $switched = false;
    792         if ( ! bp_is_root_blog() ) {
    793             switch_to_blog( bp_get_root_blog_id() );
     793        if ( $site_id !== get_current_blog_id() ) {
     794            switch_to_blog( $site_id );
    794795            $switched = true;
    795796        }
  • trunk/src/bp-groups/classes/class-bp-groups-group.php

    r10820 r10872  
    16361636        ) );
    16371637
     1638        $site_id  = bp_get_taxonomy_term_site_id( 'bp_group_type' );
    16381639        $switched = false;
    1639         if ( ! bp_is_root_blog() ) {
    1640             switch_to_blog( bp_get_root_blog_id() );
     1640        if ( $site_id !== get_current_blog_id() ) {
     1641            switch_to_blog( $site_id );
    16411642            $switched = true;
    16421643        }
Note: See TracChangeset for help on using the changeset viewer.