PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.6
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.6
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/FrmFieldFormHtml.php +6 -19 6.56.6 View file →
@@ -500,25 +500,17 @@
500 500 if ( ! in_array( $field_type, array( 'radio', 'checkbox', 'data', 'product', 'scale' ), true ) ) {
501 501 return;
502 502 }
503 503
504 - $field = (array) $this->field_obj->get_field();
505 - $attributes = array();
506 - $is_radio = 'radio' === $field_type || 'scale' === $field_type;
507 - $type_requires_aria_required = true;
504 + $field = (array) $this->field_obj->get_field();
505 + $attributes = array();
508 506
509 507 // Check if the field type is 'data' or 'product'.
510 508 if ( in_array( $field_type, array( 'data', 'product' ), true ) ) {
511 509 $data_type = FrmField::get_option( $field, 'data_type' );
512 - // Check if the data type isn't 'radio' or 'checkbox'.
513 - if ( 'radio' !== $data_type && 'checkbox' !== $data_type ) {
514 - // If data type aren't 'radio' or 'checkbox', doesn't need to add 'aria-required' to multiple input container.
515 - $type_requires_aria_required = false;
516 - }
517 - // Check if data type is 'radio'
518 - if ( 'radio' === $data_type ) {
519 - $is_radio = true;
520 - }
510 + $is_radio = 'radio' === $data_type;
511 + } else {
512 + $is_radio = 'radio' === $field_type || 'scale' === $field_type;
521 513 }
522 514
523 515 // Add 'role' attribute to the field.
524 516 $attributes['role'] = $is_radio ? 'radiogroup' : 'group';
@@ -523,15 +515,10 @@
523 515 // Add 'role' attribute to the field.
524 516 $attributes['role'] = $is_radio ? 'radiogroup' : 'group';
525 517
526 518 // Add 'aria-required' attribute to the field if required.
527 - if ( $type_requires_aria_required && '1' === $field['required'] ) {
519 + if ( $is_radio && '1' === $field['required'] ) {
528 520 $attributes['aria-required'] = 'true';
529 - }
530 -
531 - // Add 'tabindex = "0"' attribute to the radio field.
532 - if ( $is_radio ) {
533 - $attributes['tabindex'] = 0;
534 521 }
535 522
536 523 // Concatenate attributes into a string, and replace the role="group" in the HTML with the attributes string.
537 524 $html_attributes = FrmAppHelper::array_to_html_params( $attributes );