Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/04/2011 04:59:01 PM (13 years ago)
Author:
johnjamesjacoby
Message:
  • Swap BP_ROOT_BLOG const usage for new bp_get_root_blog_id() function
  • Use bp_get_root_blog_id() place of bp_get_option_blog_id()
  • Check for BP_ENABLE_MULTIBLOG when assigning root blog ID

See #3313, #3314.

File:
1 edited

Legend:

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

    r4559 r4602  
    777777                $active_components['blogs'] = 1;
    778778
    779                 // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on
    780                 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
    781                     switch_to_blog( BP_ROOT_BLOG );
     779                // Make sure that the pages are created on the bp_get_root_blog_id(), no matter which Dashboard the setup is being run on
     780                if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
     781                    switch_to_blog( bp_get_root_blog_id() );
    782782
    783783                // Move bp-pages data from the blog options table to site options
     
    789789                bp_update_option( 'bp-pages', $existing_pages );
    790790
    791                 if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
     791                if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
    792792                    restore_current_blog();
    793793
     
    831831            check_admin_referer( 'bpwizard_pages' );
    832832
    833             // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on
    834             if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
    835                 switch_to_blog( BP_ROOT_BLOG );
     833            // Make sure that the pages are created on the bp_get_root_blog_id(), no matter which Dashboard the setup is being run on
     834            if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
     835                switch_to_blog( bp_get_root_blog_id() );
    836836
    837837            // Delete any existing pages
     
    844844            bp_update_option( 'bp-pages', $blog_pages );
    845845
    846             if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != BP_ROOT_BLOG ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
     846            if ( !empty( $wpdb->blogid ) && ( $wpdb->blogid != bp_get_root_blog_id() ) && ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) )
    847847                restore_current_blog();
    848848
     
    958958            check_admin_referer( 'bpwizard_theme' );
    959959
    960             if ( is_multisite() && BP_ROOT_BLOG != get_current_blog_id() )
    961                 switch_to_blog( BP_ROOT_BLOG );
     960            if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
     961                switch_to_blog( bp_get_root_blog_id() );
    962962
    963963            switch ( $_POST['theme'] ) {
Note: See TracChangeset for help on using the changeset viewer.