lesterchan / wp-polls

Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.
https://wordpress.org/plugins/wp-polls/
93 stars 78 forks source link

change db prefix after blog site, optionally use one fixed prefix #47

Closed thesebas closed 6 years ago

thesebas commented 9 years ago

This issue is somehow related to #46, I have multisite (network) WP instalation, and wp-polls is networkwide activated. In activation hook there is loop over all sites and polls_activate() is called on each blog but $wpdb tables names are not updated so it connects to same tables over and over again. I think it is a bug because tables should be created in each blog (wp_, wp_2_, etc) but having all polls in one blog and having them accessible in all blogs was desired by me (it isn't a bug, it's a feature!), so I've added this config const POLLS_MOTHER_SITE (kill me for this name :P ) so when it is defined blog switches are ignored and all DB access is to one selected blog.

thesebas commented 9 years ago

I'm not sure how it will affect when plugin is single site activated.

lesterchan commented 9 years ago

Hmm I don't really get this, I remember I tested it, it will create with wp_, wp_2, wp_3, etc. You do not wnat that?