[wp-hackers] Idea: Widgets as custom post types

michael at mfields.org michael at mfields.org
Tue Mar 2 20:28:26 UTC 2010


Definitely +1 for storing links in the posts table.

I fail to see how storing widgets there would cut down on serialized data
(RE: Austin)... If the widget needed to store data outside of the columns
that the posts table supplies, it would most likely just end up
serializing these custom values and storing them in postmeta.



> I agree it's a good idea as well.
>
> I know that links has it's own table but if we are using wp_posts as a way
> to store this different data wouldn't it make sense to have them stored as
> a
> post_type of 'link'? Some similar data is stored here as well.
>
> On Tue, Mar 2, 2010 at 3:13 PM, Austin Matzko <austin at ilfilosofo.com>
> wrote:
>
>> On Tue, Mar 2, 2010 at 2:07 PM, scribu <scribu at gmail.com> wrote:
>> > Currently, each widget type has a an associated row in the wp_options
>> table,
>> > where all instances of itself are stored.
>> >
>> > Taking example from the nav menus in WP 3.0, why not store each widget
>> in
>> > the wp_posts table, with a post_type of 'widget' ?
>>
>> I think it's a good idea, and the post db structure fits many widgets
>> too, since they often have titles and content.  And I hate how easily
>> serialized data gets corrupted.
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
> _______________________________________________
> 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