[wp-hackers] Per-page Widget Settings

Jairus Pryor jairus at gmail.com
Thu May 31 20:53:20 GMT 2007

This makes sense. With that said, I'm running into a few issues.

The problem creating a plugin to extend the widget functionality is
that there's no hooks for the widgets. To be able to save the
sidebars/widgets to another location, I would need to change the code
in widget.php; unless there's something I'm missing.

The SBM plugin was a replacement for the WP Widgets. But since Widgets
are in WP 2.2+ core, you can't replace them anymore.


On 5/31/07, Otto <otto at ottodestruct.com> wrote:
You won't be able to accurately do separate widget options anyway,
> since each widget can store their own options anyway they like (in the
> options table seems to be the best bet). So I'd give that a miss for
> now and stick with widget arrangement, since that's the most requested
> functionality (the ability to hide certain widgets on certain kinds of
> pages).
> And ugly custom fields are already used internally elsewhere for lots
> of things. Look at _enclosure, for example. Use a key starting with an
> underscore ("_sidebars_widgets_post" for preference), because the
> underscore seems to be the standard for internal/automatic custom
> field usage. A patch can be made to hide these underscore fields from
> the interface if it's determined that that is a good idea.
> So, yes, stick to a custom field in postmeta, for per post/page settings.
> Also, use a fallback mechanism similar to the template hierarchy. If a
> single post/page has no custom field for the widgets, fallback to the
> one for all single pages (perhaps stored in the options table).
> Failing that, fallback to the default widgets layout. Same for
> archives and anything else. Store the "generic" layouts in the options
> table, with names of "sidebars_widgets_archives" and
> "sidebar_widgets_search" and such. The default is already there as
> "sidebar_widgets".

More information about the wp-hackers mailing list