#43556 closed defect (bug) (fixed)
Ensure only sidebar sections are considered when comparing against registered sidebars in Customizer
Reported by: | flixos90 | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Customize | Keywords: | has-patch commit |
Focuses: | javascript | Cc: |
Description
In the Customizer's widgets
panel, commonly sections for each registered sidebar are added. However, it is possible to also register regular sections to it, for example it may be useful to add one general settings section related to more general sidebar behavior.
For the most part this works seamlessly, there is just one detail I noticed. Commonly a notice will show in the Customizer if there is at least one registered sidebar that cannot be displayed for the currently previewed page. However this check counts all sections in the panel and compares them to the number of registered sidebars, where it should actually only count the sections that are actually intended to represent sidebars.
In my personal example, I added one additional section of type default
, and there was one section of type sidebar
which could not be displayed for the currently previewed page. However, since my default
section was active, the count matched the registered sidebar count again, causing the notice to falsely not display.
Attachments (1)
Change History (8)
#2
@
7 years ago
I think I was seeing this same thing, only I wasn't creating other sections or sidebars, so I was thinking it was counting the Inactive Widget Area when it shouldn't. Does your patch account for that?
#3
@
7 years ago
- Milestone changed from Awaiting Review to Future Release
43556.diff makes sense to me.
I was thinking it was counting the Inactive Widget Area when it shouldn't
@joyously There shouldn't be a section registered for inactive widget areas: https://github.com/WordPress/wordpress-develop/blob/7c2f975/src/wp-includes/class-wp-customize-widgets.php#L428-L468
There _is_ as setting registered for the inactive widgets sidebar, however.
#5
@
6 years ago
- Keywords commit added
- Milestone changed from Future Release to 5.0
@flixos90 it looks good to go. Engage.
43556.diff ensures that only sections of the type
sidebar
are counted, to fix this bug.