diff --git a/includes/forminputs/PF_TokensInput.php b/includes/forminputs/PF_TokensInput.php index 557eee736..1c88a4ae8 100644 --- a/includes/forminputs/PF_TokensInput.php +++ b/includes/forminputs/PF_TokensInput.php @@ -183,26 +183,9 @@ public static function getHTML( $cur_value, $input_name, $is_mandatory, $is_disa } } - foreach ( $possible_values as $possible_value ) { - if ( - array_key_exists( 'value_labels', $other_args ) && - is_array( $other_args['value_labels'] ) && - array_key_exists( $possible_value, $other_args['value_labels'] ) - ) { - $optionLabel = $other_args['value_labels'][$possible_value]; - } else { - $optionLabel = $possible_value; - } - $optionAttrs = [ 'value' => $possible_value ]; - if ( in_array( $possible_value, $cur_values ) ) { - $optionAttrs['selected'] = 'selected'; - } - $optionsText .= Html::element( 'option', $optionAttrs, $optionLabel ); - } foreach ( $cur_values as $current_value ) { - if ( !in_array( $current_value, $possible_values ) && $current_value !== '' ) { - $optionAttrs = [ 'value' => $current_value ]; - $optionAttrs['selected'] = 'selected'; + if ( $current_value !== '' ) { + $optionAttrs = [ 'value' => $current_value, 'selected' => 'selected' ]; $optionLabel = $current_value; $optionsText .= Html::element( 'option', $optionAttrs, $optionLabel ); }