[wp-hackers] Meta tables: Take 5

charles at cefm.ca charles at cefm.ca
Fri Jul 24 16:56:40 UTC 2009


What if there was an api to create a new meta table by pluggin, but also
have a "common" meta if wanted.


> So... You're suggesting making a whole new table every time a plugin
> wants to add some bit of meta, rather than simply adding a column to
> the meta table?
>
> No offense, but if I had a giant lever I could pull to open a trap
> door and drop you into the Sarlaac Pit, I would be reaching for it
> about now....
>
> Stephen
>
> P.S. -- Sorry if that seems overly harsh.  My uncle was eaten by a
> sarlaac, so I probably shouldn't joke.
>
> On Jul 24, 2009, at 6:25 AM, scribu <scribu at gmail.com> wrote:
>
>> 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
>
> _______________________________________________
> 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