Skip to content

Commit

Permalink
fix(multisite): update prefix after blog switch
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaucau committed Dec 18, 2024
1 parent c827c46 commit 01f87fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Orm/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

/**
Expand Down

0 comments on commit 01f87fa

Please sign in to comment.