[wp-trac] [WordPress Trac] #39087: Customizer: Add indicator when additional widget areas are hidden
WordPress Trac
noreply at wordpress.org
Fri Jan 27 04:52:17 UTC 2017
#39087: Customizer: Add indicator when additional widget areas are hidden
-------------------------------------------------+-------------------------
Reporter: shireling | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future
Component: Customize | Release
Severity: normal | Version:
Keywords: needs-patch has-ux-feedback good- | Resolution:
first-bug | Focuses:
-------------------------------------------------+-------------------------
Comment (by westonruter):
Replying to [comment:10 gma992]:
> Maybe I'm misunderstanding the expected behavior?
@gma992 Looks like you're using Twenty Fourteen as the basis. It turns out
that `is_active_sidebar()` will also cause a sidebar to be considered
active for a given template, in addition to a `dynamic_sidebar()` call.
When that function is called, the `is_active_sidebar` filter applies. The
widgets component in the customizer listens for that filter to sniff-out
for whether a given sidebar ''seems'' like it will be referenced on a
given template, and in that case, it will mark the section as active. This
is to handle the common case:
{{{#!php
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<div class="the-sidebar">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div>
<?php endif; ?>
}}}
However, themes also often use `is_active_sidebar()` to toggle certain
body classes. I suppose the it would be beneficial to only start listening
for `is_active_sidebar()` after the `get_header` action since it seems
that the majority of the issues related to `is_active_sidebar()` this
accidentally.
In any case, at the moment if you remove the additional
`is_active_sidebar()` calls then that should cause the sidebar sections to
not be contextual and thus you would get the `noAreasRendered` notice.
For more conversation in relation to Twenty Seventeen, see
https://wordpress.slack.com/archives/core-themes/p1484243304000235
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39087#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list