[wp-trac] [WordPress Trac] #34042: Conditional widget areas in Customizer
WordPress Trac
noreply at wordpress.org
Tue Sep 29 05:57:06 UTC 2015
#34042: Conditional widget areas in Customizer
-------------------------+-----------------------------
Reporter: Looimaster | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Customize | Version: 3.9
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+-----------------------------
Changes (by westonruter):
* version: 4.3.1 => 3.9
* milestone: Awaiting Review => Future Release
Comment:
Hi Looimaster
> I would like to show a widget area in Appearance > Widgets and in
Appearance > Customize only when the user enables the component which
requires it in Customizer.
Yes, this would be a problem as you are doing it. Sidebars can't currently
be dynamically added to the Customizer without adding some non-trivial
code to support that; it's not in core currently. An alternative approach
is you could always register the sidebar, but just not call
`dynamic_sidebar()` on it if the theme-mod is not enabled. This would
allow the sidebar to appear it gets rendered in the preview.
> Furthermore, it would be nice to show all widget areas in Customizer
(like it is in Appearance > Customize) regardless if they are currently
visible on the page or not.
The Customizer is a framework for live preview, so it doesn't make sense
to show a sidebar when it isn't rendered in the preview. If those widget
areas are to be modified en mass, they can be done so on the widgets admin
page.
> 4) If I'm on static homepage which doesn't have sidebar then it's rather
obvious to me that "Blog sidebar" is not there and I know where is it and
requiring me to click on the "Blog" link to customize that sidebar is one
step too many. Maybe in some themes and plugins it's a good idea to show
widget areas conditionally but in most it would be better to show all
available options at all times.
Please see #33052 and the proposed notice that is displayed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34042#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list