[wp-trac] [WordPress Trac] #39843: Allow a control to be displayed in multiple sections

WordPress Trac noreply at wordpress.org
Sat Feb 11 09:36:17 UTC 2017


#39843: Allow a control to be displayed in multiple sections
-------------------------+-----------------------------
 Reporter:  nikeo        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Customize    |    Version:  4.7.2
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 With the current customize API, a control can be assigned to only one
 section.

 The customization experience could be improved if a control could show up
 in multiple sections. Typically when the customizer has a lot of settings
 in many sections, it would partially solve the problem to have to navigate
 back and forth in the sections and panels.

 Theme authors need of coursee to organize their controls the most
 convenient and logical way. But they are cases when a setting is global by
 nature, and can be optionally setup in various location of the page.

 '''Use case with the social links icons :'''
 I have set up my social links in the Social Links section, which is
 located in the Global Settings panel. It make sense to define the social
 links in Global Settings panel because they can be displayed in several
 locations of the website : header, top of sidebars and footer. The
 visibility of the social links in the page is set with a checkbox control
 for each location. I uncheck the control "Social links in header".

 Later, I go back to the customizer, and now I want to design my header. To
 do that I navigate to the Header panel > Header Design section. I would
 make sense to also see there the "Social links in header" check box.

 This "ubiquity" behaviour of a control is illustrated in the gif. In the
 example, the control "Social links in header" has been assigned to both
 the Social Links and the Header Design section.

 From a code standpoint, a possible approach is to add a new argument when
 declaring the customizer control. It can be an array with the section id
 and the priority. In the customizer js control panel, the section
 expansion / collapse will be listened to, and will trigger a control move
 back and forth when relevant with api.control('control_id').section(
 'new_section_id').

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39843>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list