PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.2
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 +7 -46 6.276.2 View file →
@@ -25,13 +25,13 @@
25 25 */
26 26 protected $field_key = '';
27 27
28 28 /**
29 - * @var FrmProFieldSettings|null
29 + * @var null
30 30 *
31 31 * @since 2.03.05
32 32 */
33 - protected $field_settings;
33 + protected $field_settings = null;
34 34
35 35 /**
36 36 * @var array
37 37 *
@@ -67,37 +67,25 @@
67 67 */
68 68 protected $blank_option_label = '';
69 69
70 70 /**
71 - * @var object|null
71 + * @var object
72 72 *
73 73 * @since 2.03.05
74 74 */
75 - protected $db_row;
75 + protected $db_row = null;
76 76
77 77 /**
78 - * Field dropdowns will truncate at 25 characters by default.
79 - *
80 - * @var int|null
81 - *
82 - * @since 6.16.2
83 - */
84 - protected $truncate;
85 -
86 - /**
87 78 * FrmFieldValueSelector constructor
88 79 *
89 - * @param int|string $field_id Field ID.
90 - * @param array $args Arguments for configuring the value selector.
80 + * @param int|string $field_id
91 81 */
92 82 public function __construct( $field_id, $args ) {
93 83 $this->set_html_name( $args );
94 84 $this->set_value( $args );
95 85 $this->set_source( $args );
96 - $this->set_truncate( $args );
97 86
98 87 $this->field_id = (int) $field_id;
99 -
100 88 if ( $this->field_id === 0 ) {
101 89 return;
102 90 }
103 91
@@ -208,21 +196,8 @@
208 196 }
209 197 }
210 198
211 199 /**
212 - * @since 6.16.2
213 - *
214 - * @param array $args
215 - *
216 - * @return void
217 - */
218 - protected function set_truncate( $args ) {
219 - if ( isset( $args['truncate'] ) && is_numeric( $args['truncate'] ) ) {
220 - $this->truncate = (int) $args['truncate'];
221 - }
222 - }
223 -
224 - /**
225 200 * Check if object has any options
226 201 *
227 202 * @since 2.03.05
228 203 *
@@ -277,36 +252,22 @@
277 252 * @return void
278 253 */
279 254 protected function display_dropdown() {
280 255 echo '<select name="' . esc_attr( $this->html_name ) . '">';
281 - echo '<option value="">' . esc_html( $this->blank_option_label ) . '</option>';
256 + echo '<option value="">' . esc_attr( $this->blank_option_label ) . '</option>';
282 257
283 258 if ( ! empty( $this->options ) ) {
284 - $truncate = $this->truncate ?? 25;
285 -
286 259 foreach ( $this->options as $key => $value ) {
287 - // phpcs:ignore Universal.Operators.StrictComparisons
288 260 if ( $value == '' ) {
289 261 continue;
290 262 }
291 263
292 264 $option = $this->get_single_field_option( $key, $value );
293 - $option->print_single_option( $this->value, $truncate, $this->use_value_as_label_in_dropdown() );
265 + $option->print_single_option( $this->value, 25 );
294 266 }
295 267 }
296 268
297 269 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 270 }
310 271
311 272 /**
312 273 * Get an instance of FrmFieldOption