[wp-trac] [WordPress Trac] #47692: Optgroup in Customizer Select Control

WordPress Trac noreply at wordpress.org
Wed May 20 09:11:31 UTC 2020


#47692: Optgroup in Customizer Select Control
-------------------------+-----------------------------
 Reporter:  chintan1896  |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Customize    |     Version:  3.4
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:
-------------------------+-----------------------------

Comment (by Lwangaman):

 Replying to [comment:13 chintan1896]:
 > Hey @Lwangaman,
 >
 > What if the developer wants some choices in an optgroup and some at the
 top level of the select? So i believe with this patch code
 47692-updated.patch developer can easily manage if developer add
 multidimensional array so it will convert automatically in optgroup
 otherwise work as per current working. If you have knowledge about
 JavaScript template so please help me to add this functionality in
 WordPress.
 >
 > Thanks,
 > Chintan

 Oh I see, the boolean flag was in the original patch and not in the
 updated patch.
 I also can see why the **option label** would be declared as the
 **property value**, if you want to have spaces in the label for example it
 would not be recommended practice to have a **property name** with spaces,
 so I guess it is best to leave the **option label** as the **property
 value**. Considering that, your updated patch is the closest to the
 current logic. I will look into the javascript portion and update here if
 I have any luck.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47692#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list