From 01f87fa57d05e9c9aa1706e94584e8a99f19d10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ca=C5=82ka?= <25438601+rafaucau@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:30:21 +0100 Subject: [PATCH] fix(multisite): update prefix after blog switch --- src/Orm/Database.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Orm/Database.php b/src/Orm/Database.php index bed03f3..d9a8d60 100644 --- a/src/Orm/Database.php +++ b/src/Orm/Database.php @@ -78,6 +78,11 @@ public function __construct() ); $this->db = $wpdb; + + // Add hook to update prefix when switching between blogs in multisite + add_action('switch_blog', function() { + $this->setTablePrefix($this->db->prefix); + }); } /**