Skip to content

Commit 101bb2b

Browse files
committed
Fix: WPMS. Migrate old WPMS to the new wpms mode #3.
1 parent 3b44dac commit 101bb2b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

inc/cleantalk-updater.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,14 @@ function apbct_update_to_5_161_1()
14141414

14151415
if ( $apbct->is_multisite ) {
14161416
$apbct->network_settings = array_merge((array)$apbct->network_settings, $apbct->default_network_settings);
1417+
// Migrate old WPMS to the new wpms mode
1418+
if ( isset($apbct->network_settings['multisite__allow_custom_key']) ) {
1419+
if ( $apbct->network_settings['multisite__allow_custom_key'] == 1 ) {
1420+
$apbct->network_settings['multisite__work_mode'] = 1;
1421+
} else {
1422+
$apbct->network_settings['multisite__work_mode'] = 2;
1423+
}
1424+
}
14171425
$apbct->saveNetworkSettings();
14181426
}
14191427
}
@@ -1501,8 +1509,8 @@ function apbct_update_to_5_162_1()
15011509
}
15021510

15031511
// Migrate old WPMS to the new wpms mode
1504-
if ( isset($apbct->settings['multisite__allow_custom_key']) ) {
1505-
if ( $apbct->settings['multisite__allow_custom_key'] == 1 ) {
1512+
if ( isset($apbct->network_settings['multisite__allow_custom_key']) ) {
1513+
if ( $apbct->network_settings['multisite__allow_custom_key'] == 1 ) {
15061514
$apbct->network_settings['multisite__work_mode'] = 1;
15071515
} else {
15081516
$apbct->network_settings['multisite__work_mode'] = 2;

0 commit comments

Comments
 (0)