[wp-hackers] Prevent display of dynamic sidebar in widgets.php

Chip Bennett chip at chipbennett.net
Sun May 15 17:41:55 UTC 2011


I think Nacin means: don't register/call a dynamic sidebar; instead, just
output calls to the_widget() in whatever location in the template in which
you would have otherwise called dynamic_sidebar().

Here's an example of using
the_widget()<https://github.com/chipbennett/oenology/blob/master/sidebar-right.php>
.

Chip

On Sun, May 15, 2011 at 11:55 AM, Andy Charrington-Wilden <
andycharrington at gmail.com> wrote:

> Hi Nacin
>
> Thanks for the response. I'm not sure what you mean though. Could you
> please elaborate a little?
>
> I am successfully emulating the widgets page functionality in my plugin to
> allow assigning of widgets to sidebars.
>
> I'm not sure how using the widget call would work?
>
> Thanks!
>
> Sent from my iPhone
>
> On 15 May 2011, at 17:25, Andrew Nacin <wp at andrewnacin.com> wrote:
>
> > On May 14, 2011 4:24 PM, "Andy Charrington-Wilden" <
> > andycharrington at gmail.com> wrote:
> >>
> >> Hi all
> >>
> >> I am trying to find a way to exclude a dynamic sidebar from the default
> > widgets page (widgets.php) in wp-admin. I know it sounds crazy but I am
> > using dynamic sidebars as part of a plugin and as such don't want the
> user
> > to be able to assign widgets to the sidebars my plugin creates.
> >>
> >> Does that makes sense? I hope so!
> >>
> >> I haven't found any hooks I can use, so am wondering if the only option
> is
> > to use CSS to hide the sidebar in widgets.php. Not the ideal solution to
> be
> > honest so was hoping someone here had some bright ideas!
> >
> > Instead of leveraging dynamic_side ar() maybe your plugin should just
> call
> > the_widget(). There isn't an API for assigning widgets to sidebars
> anyway.
> >
> > Nacin
> > _______________________________________________
> > 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