PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.18
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.18
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmFieldValueSelector.php +8 -24 6.336.18 View file →
@@ -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
@@ -102,15 +100,13 @@
102 100 }
103 101
104 102 $this->set_db_row();
105 103
106 - if ( ! $this->has_db_row() ) {
107 - return;
104 + if ( $this->has_db_row() ) {
105 + $this->set_field_key();
106 + $this->set_field_settings();
107 + $this->set_options();
108 108 }
109 -
110 - $this->set_field_key();
111 - $this->set_field_settings();
112 - $this->set_options();
113 109 }
114 110
115 111 /**
116 112 * Set the db_row property
@@ -281,34 +277,22 @@
281 277 protected function display_dropdown() {
282 278 echo '<select name="' . esc_attr( $this->html_name ) . '">';
283 279 echo '<option value="">' . esc_html( $this->blank_option_label ) . '</option>';
284 280
285 - if ( $this->options ) {
286 - $truncate = $this->truncate ?? 25;
281 + if ( ! empty( $this->options ) ) {
282 + $truncate = isset( $this->truncate ) ? $this->truncate : 25;
287 283
288 284 foreach ( $this->options as $key => $value ) {
289 - // phpcs:ignore Universal.Operators.StrictComparisons
290 285 if ( $value == '' ) {
291 286 continue;
292 287 }
293 288
294 289 $option = $this->get_single_field_option( $key, $value );
295 - $option->print_single_option( $this->value, $truncate, $this->use_value_as_label_in_dropdown() );
290 + $option->print_single_option( $this->value, $truncate );
296 291 }
297 292 }
298 293
299 294 echo '</select>';
300 - }
301 -
302 - /**
303 - * Whether to use the field value as the option label in the dropdown when the label is empty.
304 - *
305 - * @since 6.25.1
306 - *
307 - * @return bool
308 - */
309 - protected function use_value_as_label_in_dropdown() {
310 - return false;
311 295 }
312 296
313 297 /**
314 298 * Get an instance of FrmFieldOption