[wp-hackers] Per-page Widget Settings

Jairus Pryor jairus at gmail.com
Thu May 31 18:27:26 GMT 2007


On 5/31/07, Austin Matzko <if.website at gmail.com> wrote:
On 5/31/07, Jairus Pryor <jairus at gmail.com> wrote:
> > I'm developing a plugin which would allow you to define your widget
> > layout/options on a per page/post setting (as per TRAC ticket #4280),
> > and I thought I'd ask for feedback before I make any structural
> > decisions. What I'm thinking:
> >
> >
> > *Storage
> > New table, say wp_postext
> > Fields:
> >  post_id (BIGINT 20) primary index-> for storing which post this
> > setting belongs to
> >  widgets (TEXT) -> for storing which widgets are available, in a
> > serialized array (similar to active_plugins in wp_options)
> >  widget_options (TEXT) -> for storing options for the widget, in
> > serialized array
>
> Why don't you use the postmeta table instead of creating a new table?


To store into post_meta, we'd need one row for the active widgets and
their order. and a second row for the options of the widgets.
That means 2 integers and 2 meta_keys would have be added OVER what
would be required if we were using a new table.

Also, post_meta is used to store the custom values as well... not many
users would want to see two custom fields of serialzied arrays in
every post.

Jairus


More information about the wp-hackers mailing list