Skip to content

Commit c07972c

Browse files
committed
Use default label instead of key
1 parent 5df6d34 commit c07972c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

dt-core/utilities/dt-components.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,12 @@ public static function render_location_meta( $field_key, $fields, $post, $params
170170
public static function render_multi_select( $field_key, $fields, $post, $params = [] ) {
171171
$shared_attributes = self::shared_attributes( $field_key, $fields, $post, $params );
172172
$options_array = $fields[$field_key]['default'];
173-
$options_array = array_map(function ( $key, $value ) {
173+
$dt_global_languages_list = dt_get_global_languages_list();
174+
175+
$options_array = array_map(function ( $key, $value ) use ( $dt_global_languages_list ) {
174176
return [
175177
'id' => $key,
176-
'label' => !empty( $value['label'] ) ? $value['label'] : $key,
178+
'label' => !empty( $value['label'] ) ? $value['label'] : ( isset( $dt_global_languages_list[$key] ) ? $dt_global_languages_list[$key]['label'] : $key ),
177179
'color' => $value['color'] ?? null,
178180
'icon' => $value['icon'] ?? null,
179181
];

0 commit comments

Comments
 (0)