diff --git a/src/Orm/Database.php b/src/Orm/Database.php index 0e04af7..f68d60e 100644 --- a/src/Orm/Database.php +++ b/src/Orm/Database.php @@ -78,8 +78,12 @@ public function __construct() ); $this->db = $wpdb; + $this->addWordPresHooks(); + } - // Add hook to update prefix when switching between blogs in multisite + protected function addWordPresHooks(): void + { + // Reset Database instance when switching between blogs in multisite to update prefix add_action('switch_blog', function () { self::$instance = null; });