Changeset 7192 for trunk/bp-loader.php
- Timestamp:
- 06/09/2013 01:39:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-loader.php
r7167 r7192 224 224 require( WP_PLUGIN_DIR . '/bp-custom.php' ); 225 225 226 // Define on which blog ID BuddyPress should run 227 if ( !defined( 'BP_ROOT_BLOG' ) ) { 228 229 // Default to 1 230 $root_blog_id = 1; 231 232 // Root blog is the main site on this network 233 if ( is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ) { 234 $current_site = get_current_site(); 235 $root_blog_id = $current_site->blog_id; 236 237 // Root blog is every site on this network 238 } elseif ( is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) ) { 239 $root_blog_id = get_current_blog_id(); 240 } 241 242 define( 'BP_ROOT_BLOG', $root_blog_id ); 226 // Path and URL 227 if ( ! defined( 'BP_PLUGIN_DIR' ) ) { 228 define( 'BP_PLUGIN_DIR', trailingslashit( WP_PLUGIN_DIR . '/buddypress' ) ); 243 229 } 244 230 245 // Path and URL 246 if ( !defined( 'BP_PLUGIN_DIR' ) ) 247 define( 'BP_PLUGIN_DIR', trailingslashit( WP_PLUGIN_DIR . '/buddypress' ) ); 248 249 if ( !defined( 'BP_PLUGIN_URL' ) ) { 231 if ( ! defined( 'BP_PLUGIN_URL' ) ) { 250 232 $plugin_url = plugin_dir_url( __FILE__ ); 251 233 … … 255 237 256 238 define( 'BP_PLUGIN_URL', $plugin_url ); 239 } 240 241 // Define on which blog ID BuddyPress should run 242 if ( ! defined( 'BP_ROOT_BLOG' ) ) { 243 244 // Default to use current blog ID 245 // Fulfills non-network installs and BP_ENABLE_MULTIBLOG installs 246 $root_blog_id = get_current_blog_id(); 247 248 // Multisite check 249 if ( is_multisite() ) { 250 251 // Multiblog isn't enabled 252 if ( ! defined( 'BP_ENABLE_MULTIBLOG' ) || ( defined( 'BP_ENABLE_MULTIBLOG' ) && (int) constant( 'BP_ENABLE_MULTIBLOG' ) === 0 ) ) { 253 // Check to see if BP is network-activated 254 // We're not using is_plugin_active_for_network() b/c you need to include the 255 // /wp-admin/includes/plugin.php file in order to use that function. 256 257 // get network-activated plugins 258 $plugins = get_site_option( 'active_sitewide_plugins'); 259 260 // basename 261 $basename = plugin_basename( constant( 'BP_PLUGIN_DIR' ) . 'bp-loader.php' ); 262 263 // plugin is network-activated; use main site ID instead 264 if ( isset( $plugins[ $basename ] ) ) { 265 $current_site = get_current_site(); 266 $root_blog_id = $current_site->blog_id; 267 } 268 } 269 270 } 271 272 define( 'BP_ROOT_BLOG', $root_blog_id ); 257 273 } 258 274
Note: See TracChangeset
for help on using the changeset viewer.