[wp-hackers] Per-page Widget Settings

Jairus Pryor jairus at gmail.com
Thu May 31 17:33:55 GMT 2007


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

*Implementation Tasks
1)Modify how widgets saved (store to new table instead of to the
active_widgets option)
2)Modify how pages are loaded so that widgets are being read based on post_id
3)Modify edit/create pages to include widget layout section


What do people think? Any constructive comments/suggestions would be
appreciated.

Jairus


More information about the wp-hackers mailing list