PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 4.11.02
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v4.11.02
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/fields/FrmFieldCombo.php +6 -20 6.3.24.11.02 View file →
@@ -46,10 +46,8 @@
46 46 /**
47 47 * Registers sub fields.
48 48 *
49 49 * @param array $sub_fields Sub fields. Accepts array or array or array of string.
50 - *
51 - * @return void
52 50 */
53 51 protected function register_sub_fields( array $sub_fields ) {
54 52 $defaults = $this->get_default_sub_field();
55 53
@@ -132,12 +130,9 @@
132 130 * Include the settings for placeholder, default value, and sub labels for each
133 131 * of the individual field labels.
134 132 *
135 133 * @since 4.0
136 - *
137 134 * @param array $args Includes 'field', 'display'.
138 - *
139 - * @return void
140 135 */
141 136 public function show_after_default( $args ) {
142 137 $field = (array) $args['field'];
143 138 $default_value = $this->get_default_value();
@@ -218,10 +213,8 @@
218 213 /**
219 214 * Shows field on the form builder.
220 215 *
221 216 * @param string $name Field name.
222 - *
223 - * @return void
224 217 */
225 218 public function show_on_form_builder( $name = '' ) {
226 219 $field = FrmFieldsHelper::setup_edit_vars( $this->field );
227 220
@@ -280,10 +273,8 @@
280 273 * @type array $shortcode_atts Shortcode attributes.
281 274 * @type array $errors Field errors.
282 275 * @type bool $remove_names Remove name attribute or not.
283 276 * }
284 - *
285 - * @return void
286 277 */
287 278 protected function load_field_output( $args ) {
288 279 if ( empty( $args['field'] ) ) {
289 280 return;
@@ -316,10 +307,8 @@
316 307 * @type array $shortcode_atts Shortcode attributes.
317 308 * @type array $errors Field errors.
318 309 * @type bool $remove_names Remove name attribute or not.
319 310 * }
320 - *
321 - * @return void
322 311 */
323 312 protected function process_args_for_field_output( &$args ) {
324 313 $args['field'] = (array) $args['field'];
325 314
@@ -345,20 +334,19 @@
345 334 /**
346 335 * Prints sub field input atts.
347 336 *
348 337 * @param array $args Arguments. Includes `field`, `sub_field`.
349 - *
350 - * @return void
351 338 */
352 339 protected function print_input_atts( $args ) {
353 340 $field = $args['field'];
354 341 $sub_field = $args['sub_field'];
342 + $atts = array();
355 343
356 344 // Placeholder.
357 345 if ( in_array( 'placeholder', $sub_field['options'], true ) ) {
358 346 $placeholders = FrmField::get_option( $field, 'placeholder' );
359 347 if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) {
360 - $field['placeholder'] = $placeholders[ $sub_field['name'] ];
348 + $atts[] = 'placeholder="' . esc_attr( $placeholders[ $sub_field['name'] ] ) . '"';
361 349 }
362 350 }
363 351
364 352 // Add optional class.
@@ -371,21 +359,19 @@
371 359 $classes .= ' frm_optional';
372 360 }
373 361
374 362 if ( $classes ) {
375 - $field['input_class'] = esc_attr( $classes );
363 + $atts[] = 'class="' . esc_attr( $classes ) . '"';
376 364 }
377 365
378 - $field['default_value'] = ''; // fake it to avoid printing frm-val attribute.
379 -
380 - do_action( 'frm_field_input_html', $field );
381 -
382 366 // Print custom attributes.
383 367 if ( ! empty( $sub_field['atts'] ) && is_array( $sub_field['atts'] ) ) {
384 368 foreach ( $sub_field['atts'] as $att_name => $att_value ) {
385 - echo esc_attr( trim( $att_name ) ) . '="' . esc_attr( trim( $att_value ) ) . '" ';
369 + $atts[] = esc_attr( trim( $att_name ) ) . '="' . esc_attr( trim( $att_value ) ) . '"';
386 370 }
387 371 }
372 +
373 + echo implode( ' ', $atts ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
388 374 }
389 375
390 376 /**
391 377 * Validate field.