Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for WordPress Multisite #101

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Next Next commit
fix(multisite): update prefix after blog switch
  • Loading branch information
rafaucau committed Dec 18, 2024
commit 01f87fa57d05e9c9aa1706e94584e8a99f19d10e
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
Loading