Skip to content

Commit 71bfd60

Browse files
authored
Make sure the migration script is run on Multisite
Fixes #31
1 parent 20f014e commit 71bfd60

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

class-bp-classic.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,15 @@ public static function is_buddypress_supported() {
178178

179179
$bp_classic_plugin_basename = plugin_basename( __FILE__ );
180180

181-
// Informs about whether BuddyPress is network activated or not.
182-
self::$network_config->bp_classic_is_network_active = isset( $sitewide_plugins[ $bp_classic_plugin_basename ] );
181+
// Informs about whether BP Classic is network activated or not.
182+
$bp_classic_is_network_active = isset( $sitewide_plugins[ $bp_classic_plugin_basename ] );
183+
184+
// If BP Classic is being activated on the network set it as network activated to run the migration script.
185+
if ( ! $bp_classic_is_network_active && is_network_admin() && 'activate_bp-classic/class-bp-classic.php' === current_action() ) {
186+
$bp_classic_is_network_active = true;
187+
}
188+
189+
self::$network_config->bp_classic_is_network_active = $bp_classic_is_network_active;
183190

184191
// BP & BP Classic need to be activated the same way in Multisite configs.
185192
if ( self::$network_config->bp_classic_is_network_active !== self::$network_config->bp_is_network_active ) {

0 commit comments

Comments
 (0)