[wp-hackers] MU-compatbility with custom plugin tables?
Glenn Ansley
glenn at glennansley.com
Tue Dec 1 02:08:28 UTC 2009
I would create a flag for each blog (maybe the blog options table)
each time a blog used your plugin for the first time.
On first use, use dbdelta to create the table.
Glenn Ansley
http://fullthrottledevelopment.com
http://twitter.com/glennansley
On Mon, Nov 30, 2009 at 8:28 PM, Austin Matzko <if.website at gmail.com> wrote:
> On Mon, Nov 30, 2009 at 7:19 PM, Derek Hogue <derek at amphibian.info> wrote:
>> Thanks for that Austin, that's good to know - though, that's not
>> exactly what I was looking for. I do need everyone using their own
>> tables, as they'll be posting their own list of shows.
>>
>> So, current behavior in terms of inserting data is fine - it's looking
>> for the tables that I *want* to be there. But since GigPress is
>> installed in 'mu-plugins', blog users never activate the plugin, so
>> their own set of tables never get installed.
>>
>> I suppose I could do a quick 'SHOW tables LIKE' check on admin_init to
>> see if the tables are there, and if not, install them, but that seems
>> excessive.
>
> You might check for MU and disable functionality (with an admin
> warning message for site admins) until the site admin runs a setup
> script that creates all tables. In that case it would be only a check
> for a single option marking whether installation has completed.
>
> From that point forward you could trigger table creation whenever
> someone creates a new blog.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list