Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/12/2016 09:01:07 PM (6 years ago)
Author:
djpaul
Message:

Core: be on root blog when installing, and register taxonomies.

Similar to r10580, we needed to make sure the email type taxonomy is
registered when we switch_to_blog to install BuddyPress.

Fixes #6892

Props boonebgorges, DJPaul, imath

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-update.php

    r10497 r10582  
    206206
    207207    require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' );
     208    $switched_to_root_blog = false;
     209
     210    // Make sure the current blog is set to the root blog
     211    if ( ! bp_is_root_blog() ) {
     212        switch_to_blog( bp_get_root_blog_id() );
     213        bp_register_taxonomies();
     214
     215        $switched_to_root_blog = true;
     216    }
    208217
    209218    // Install BP schema and activate only Activity and XProfile.
     
    273282    // Bump the version.
    274283    bp_version_bump();
     284
     285    if ( $switched_to_root_blog ) {
     286        restore_current_blog();
     287    }
    275288}
    276289
Note: See TracChangeset for help on using the changeset viewer.