| @@ -85,10 +85,9 @@ | ||
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * FrmFieldValueSelector constructor |
| 88 | 88 | * |
| 89 | - * @param int|string $field_id Field ID. | |
| 90 | - * @param array $args Arguments for configuring the value selector. | |
| 89 | + * @param int|string $field_id | |
| 91 | 90 | */ |
| 92 | 91 | public function __construct( $field_id, $args ) { |
| 93 | 92 | $this->set_html_name( $args ); |
| 94 | 93 | $this->set_value( $args ); |
| @@ -95,9 +94,8 @@ | ||
| 95 | 94 | $this->set_source( $args ); |
| 96 | 95 | $this->set_truncate( $args ); |
| 97 | 96 | |
| 98 | 97 | $this->field_id = (int) $field_id; |
| 99 | - | |
| 100 | 98 | if ( $this->field_id === 0 ) { |
| 101 | 99 | return; |
| 102 | 100 | } |
| 103 | 101 | |
| @@ -280,33 +278,21 @@ | ||
| 280 | 278 | echo '<select name="' . esc_attr( $this->html_name ) . '">'; |
| 281 | 279 | echo '<option value="">' . esc_html( $this->blank_option_label ) . '</option>'; |
| 282 | 280 | |
| 283 | 281 | if ( ! empty( $this->options ) ) { |
| 284 | - $truncate = $this->truncate ?? 25; | |
| 282 | + $truncate = isset( $this->truncate ) ? $this->truncate : 25; | |
| 285 | 283 | |
| 286 | 284 | foreach ( $this->options as $key => $value ) { |
| 287 | - // phpcs:ignore Universal.Operators.StrictComparisons | |
| 288 | 285 | if ( $value == '' ) { |
| 289 | 286 | continue; |
| 290 | 287 | } |
| 291 | 288 | |
| 292 | 289 | $option = $this->get_single_field_option( $key, $value ); |
| 293 | - $option->print_single_option( $this->value, $truncate, $this->use_value_as_label_in_dropdown() ); | |
| 290 | + $option->print_single_option( $this->value, $truncate ); | |
| 294 | 291 | } |
| 295 | 292 | } |
| 296 | 293 | |
| 297 | 294 | echo '</select>'; |
| 298 | - } | |
| 299 | - | |
| 300 | - /** | |
| 301 | - * Whether to use the field value as the option label in the dropdown when the label is empty. | |
| 302 | - * | |
| 303 | - * @since 6.25.1 | |
| 304 | - * | |
| 305 | - * @return bool | |
| 306 | - */ | |
| 307 | - protected function use_value_as_label_in_dropdown() { | |
| 308 | - return false; | |
| 309 | 295 | } |
| 310 | 296 | |
| 311 | 297 | /** |
| 312 | 298 | * Get an instance of FrmFieldOption |