[wp-hackers] Meta tables: Take 5
mikeschinkel at newclarity.net
mikeschinkel at newclarity.net
Fri Jul 24 15:22:29 UTC 2009
That's feeling very Drupalish, but in a good way.
+1
Sent from my iPhone
On Jul 24, 2009, at 6:25 AM, 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