diff --git a/wp-includes/class-wp-customize-control.php b/wp-includes/class-wp-customize-control.php
index 994ff90..97cd7b5 100644
|
a
|
b
|
class WP_Customize_Control { |
| 116 | 116 | public $choices = array(); |
| 117 | 117 | |
| 118 | 118 | /** |
| | 119 | * Optgroup for select control. |
| | 120 | * |
| | 121 | * @since 5.3.0 |
| | 122 | * @var bool |
| | 123 | */ |
| | 124 | public $optgroup = false; |
| | 125 | |
| | 126 | /** |
| 119 | 127 | * List of custom input attributes for control output, where attribute names are the keys and values are the values. |
| 120 | 128 | * |
| 121 | 129 | * Not used for 'checkbox', 'radio', 'select', 'textarea', or 'dropdown-pages' control types. |
| … |
… |
class WP_Customize_Control { |
| 546 | 554 | |
| 547 | 555 | <select id="<?php echo esc_attr( $input_id ); ?>" <?php echo $describedby_attr; ?> <?php $this->link(); ?>> |
| 548 | 556 | <?php |
| 549 | | foreach ( $this->choices as $value => $label ) { |
| 550 | | echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>'; |
| | 557 | if ( $this->optgroup ) { |
| | 558 | foreach ( $this->choices as $optgroup_label => $values ) { |
| | 559 | if ( is_array( $values ) ) { |
| | 560 | echo '<optgroup label="' . esc_attr( $optgroup_label ) . '">'; |
| | 561 | foreach ( $values as $value => $label ) { |
| | 562 | if ( ! is_array( $label ) ) { |
| | 563 | echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>'; |
| | 564 | } |
| | 565 | } |
| | 566 | echo '</optgroup>'; |
| | 567 | } |
| | 568 | } |
| | 569 | } else{ |
| | 570 | foreach ( $this->choices as $value => $label ) { |
| | 571 | if ( ! is_array( $label ) ) { |
| | 572 | echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>'; |
| | 573 | } |
| | 574 | } |
| 551 | 575 | } |
| 552 | 576 | ?> |
| 553 | 577 | </select> |