Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 6 years ago

#38561 closed defect (bug) (fixed)

Custom header sections show in the Customizer without any choices

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

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 10 years ago.
38561.diff (3.0 KB ) - added by bradyvercher 10 years ago.
38561.1.diff (1.1 KB ) - added by bradyvercher 10 years ago.

Download all attachments as: .zip

Change History (11)

@bradyvercher
10 years ago

#1 @bradyvercher
10 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 10 years ago by bradyvercher (previous) (diff)

#2 @westonruter
10 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.

#3 @bradyvercher
10 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
10 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

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

#5 @westonruter
10 years ago

  • Owner set to westonruter
  • Resolution duplicatefixed

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
10 years ago

#38366 was marked as a duplicate.

#7 @westonruter
10 years ago

#39375 was marked as a duplicate.

#8 @SergeyBiryukov
6 years ago

  • Milestone4.6
Note: See TracTickets for help on using tickets.