Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #47692, comment 10


Ignore:
Timestamp:
05/12/2020 03:28:48 PM (5 years ago)
Author:
Lwangaman
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #47692, comment 10

    initial v1  
    2727                                if(is_array($value)){
    2828                                        echo '<optgroup label="' . esc_attr( $label ) . '">';
    29                                         foreach( $value as $label => $value ){
    30                                                 echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>';
     29                                        foreach( $value as $optgrouplabel => $optgroupvalue ){
     30                                                echo '<option value="' . esc_attr( $optgroupvalue  ) . '"' . selected( $this->value(), $optgroupvalue , false ) . '>' . $optgrouplabel. '</option>';
    3131                                        }
    3232                                        echo '</optgroup>';