[wp-trac] [WordPress Trac] #39087: Customizer: Add indicator when additional widget areas are hidden
WordPress Trac
noreply at wordpress.org
Fri Jan 27 05:15:47 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):
@gma992 nevermind, [attachment:39087.experiment.diff] is a proof of
concept for what I had in mind. The `get_header` action is no good because
it fires before the header is output. So the only halfway-working hack is
to listen for the `body_class` filter to have been applied (not pretty),
but that still doesn't completely do the trick for Twenty Seventeen
because there are additional `is_active_sidebar` calls in the
`wp_calculate_image_sizes` filter. So Twenty Seventeen would still need
patching:
{{{#!diff
--- src/wp-content/themes/twentyseventeen/functions.php
+++ src/wp-content/themes/twentyseventeen/functions.php
@@ -477,7 +477,7 @@ function twentyseventeen_content_image_sizes_attr(
$sizes, $size ) {
$sizes = '(max-width: 706px) 89vw, (max-width: 767px)
82vw, 740px';
}
- if ( is_active_sidebar( 'sidebar-1' ) || is_archive() ||
is_search() || is_home() || is_page() ) {
+ if ( is_archive() || is_search() || is_home() || is_page() ||
is_active_sidebar( 'sidebar-1' ) ) {
if ( ! ( is_page() && 'one-column' === get_theme_mod(
'page_options' ) ) && 767 <= $width ) {
$sizes = '(max-width: 767px) 89vw, (max-width:
1000px) 54vw, (max-width: 1071px) 543px, 580px';
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39087#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list