Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#38561 closed defect (bug) (fixed)

Custom header sections show in the Customizer without any choices

Reported by: bradyvercher's profile bradyvercher Owned by: westonruter's profile westonruter
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.6
Component: Customize Keywords: has-patch
Focuses: Cc:

Description

The "Previously uploaded" and "Suggested" titles in the "Header Images" section are always showing in the Customizer, even when they don't have any options available. They were hidden when empty in previous versions.

The attached screenshot when using Twenty Fifteen should help clarify.

Attachments (3)

empty-header-sections.png (61.3 KB) - added by bradyvercher 8 years ago.
38561.diff (3.0 KB) - added by bradyvercher 8 years ago.
38561.1.diff (1.1 KB) - added by bradyvercher 8 years ago.

Download all attachments as: .zip

Change History (11)

@bradyvercher
8 years ago

#1 @bradyvercher
8 years ago

It looks like this broke in [37476] when the DOM was changed to insert a notification container after the title. 38561.diff wraps the sections in a container to fix the previous behavior and adds some much needed spacing between the sections.

Last edited 8 years ago by bradyvercher (previous) (diff)

#2 @westonruter
8 years ago

@bradyvercher The injection of the notifications container is done as a fallback in case the control didn't include the container itself. So you can add the notifications container to the control's content template to specifically control where it appears.

@bradyvercher
8 years ago

#3 @bradyvercher
8 years ago

  • Keywords has-patch added

Thanks @westonruter! 38561.1.diff adds the notification container to the header control instead. On closer inspection, that prevents it from being duplicated and injected in the wrong place as well.

#4 @westonruter
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

@bradyvercher Your patch looks like it addresses the issue better than the patch on #38366, for which this is actually a duplicate.

#5 @westonruter
8 years ago

  • Owner set to westonruter
  • Resolution changed from duplicate to fixed

In 39145:

Customize: For Header Image, ensure "Previously uploaded" and "Suggested" headings are hidden when lists are empty.

Fixes regression introduced with the addition of control notifications in [37476]. The container element for notifications is injected after the .customize-control-title element if the .customize-control-notifications-container element does not already exist in the control's template. Also adds missing margin between current image and uploaded images.

Props bradyvercher.
See #34893.
Fixes #38561.

#6 @westonruter
8 years ago

#38366 was marked as a duplicate.

#7 @westonruter
8 years ago

#39375 was marked as a duplicate.

#8 @SergeyBiryukov
4 years ago

  • Milestone set to 4.6
Note: See TracTickets for help on using tickets.