Skip to content

Commit 9cc8cd6

Browse files
committed
Fix. WPMS. Settings for mutual/mutual fixed.
1 parent db65343 commit 9cc8cd6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Cleantalk/ApbctWP/State.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,14 @@ protected function setOptions()
566566
$wpdb_option_name = $this->option_prefix . '_' . $option_name;
567567
//prevent fatal on broken serialized data
568568
try {
569-
$option = get_option($wpdb_option_name);
569+
if ( ! is_main_site() && $this->network_settings['multisite__work_mode'] == 2 ) {
570+
// Options have to be gathered from the main site in this case
571+
switch_to_blog(get_main_site_id());
572+
$option = get_option($wpdb_option_name);
573+
restore_current_blog();
574+
} else {
575+
$option = get_option($wpdb_option_name);
576+
}
570577
} catch (\UnexpectedValueException $e) {
571578
$default_option_name = 'default_' . $option_name;
572579
delete_option($wpdb_option_name);

0 commit comments

Comments
 (0)