Skip to:
Content

BuddyPress.org

Changeset 4602 for trunk/bp-loader.php


Ignore:
Timestamp:
07/04/2011 04:59:01 PM (15 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-loader.php

    r4556 r4602  
    2828// Define on which blog ID BuddyPress should run
    2929if ( !defined( 'BP_ROOT_BLOG' ) ) {
    30         if ( is_multisite() ) {
     30       
     31        // Root blog is the main site on this network
     32        if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) {
    3133                $current_site = get_current_site();
    3234                $root_blog_id = $current_site->blog_id;
    33         } else {
     35               
     36        // Root blog is every site on this network
     37        } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     38                $root_blog_id = get_current_blog_id();
     39               
     40        // Root blog is the only blog on this network
     41        } elseif( !is_multisite() ) {
    3442                $root_blog_id = 1;
    3543        }
    … …  
    104112        // Switch the user to the new bp-default if they are using the old
    105113        // bp-default on activation.
    106         if ( 'bp-sn-parent' == get_blog_option( BP_ROOT_BLOG, 'template' ) && 'bp-default' == get_blog_option( BP_ROOT_BLOG, 'stylesheet' ) )
     114        if ( 'bp-sn-parent' == get_blog_option( bp_get_root_blog_id(), 'template' ) && 'bp-default' == get_blog_option( bp_get_root_blog_id(), 'stylesheet' ) )
    107115                switch_theme( 'bp-default', 'bp-default' );
    108116
Note: See TracChangeset for help on using the changeset viewer.