[wp-hackers] Programmatic Widget Handling

Moya, Eddie emoya at tribune.com
Wed Oct 20 18:02:30 UTC 2010

No, I don't have that. But I did forget to mention when I talked about future additions. However, I don't think I would be making it work the way you seem to be describing.

An issue we have run into is attempting to constrain what sidebars a widget can be used in. For example, for the Candidate Blogs network I was asked to build this big blue box above the main content with some brief candidate details. The big problem I didn't want a bunch of support tickets coming in because someone stuck it in the right rail.

example: http://candidateblogs.sun-sentinel.com/steve-edmonds/

My hacked solution was to use a whole bunch of css hacks to enforce the limitation.

We need to have this sort of constraint available. This I think I can do. In fact I only have not added it because other priorities have taken up my time. I am fairly certain that creating a way of having logic where it only loads in a sidebar named "sidebar1" for example. I think the quick (less elegant) solution will be to let users add the widget to whatever sidebar they want, but simply have that widget not work if the constraint is not met.

Eddie Moya
Applications Developer
Tribune Technology

On 10/20/10 12:36 PM, "Brian Layman" <bulk at thecodecave.com> wrote:

Eddie Moya wrote:
> $widget_pack->add_widget("My_Widget");

Ooo that sounds interesting..

I don't see the specification of which sidebar the widgets are going into in
your examples, but do you have that and the ability to set the position of
the widget within the sidebar? I agree; it would be great to have a simple
API for all this..

Brian Layman

wp-hackers mailing list
wp-hackers at lists.automattic.com

More information about the wp-hackers mailing list