[wp-hackers] Meta tables: Take 5
Jacob Santos
wordpress at santosj.name
Fri Jul 24 13:34:01 UTC 2009
Am I to assume this is a multiple table approach? For example, comment meta table, post meta table, user meta table, etc.
Jacob Santos
On Fri, 24 Jul 2009 13:21:31 +0300
scribu <scribu at gmail.com> wrote:
> Yes, this subject has been discussed a lot recently, both on trac, as well
> as on the dev chat. But I think the solution I'm about to propose has been
> overlooked. It is based on two principles:
>
> - WP core shouldn't create tables that it doesn't use. The same principle is
> applied to bundled javascript and php classes.
>
> - Having a combined meta table for all, or most, object types makes for bad
> performance, especially when we consider MU instalations.
>
> So, I propose that Core have an API for creating standard meta tables for
> whatever plugins need.
>
> Of course, this would be accompanied by unified functions for handling meta
> data in said tables.
>
> Example: A plugin needs a comment meta table. First, it makes sure it's
> available:
>
> register_activation_hook(__FILE__, 'example_plugin_activation');
>
> function example_plugin_activation() {
> enable_meta_table('comment');
> }
>
>
> Then, it uses it to store data, etc.:
>
> ...
> add_meta('comment', $comment_id, $meta_key, $meta_value);
> ...
>
>
> I am willing to code this API, if people think it's a sound ideea.
>
>
> By the way, I also wrote a blog post about this:
> http://scribu.net/wordpress/meta-tables-for-wordpress.html
>
>
> --
> http://scribu.net
> _______________________________________________
> 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