| @@ -229,9 +229,9 @@ | ||
| 229 | 229 | * @since 3.0 |
| 230 | 230 | */ |
| 231 | 231 | private function replace_error_shortcode() { |
| 232 | 232 | $this->maybe_add_error_id(); |
| 233 | - $error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false; | |
| 233 | + $error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false; | |
| 234 | 234 | |
| 235 | 235 | if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) { |
| 236 | 236 | $error_body = self::get_error_body( $this->html ); |
| 237 | 237 | if ( is_string( $error_body ) && false === strpos( $error_body, 'role=' ) ) { |
| @@ -386,9 +386,9 @@ | ||
| 386 | 386 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 387 | 387 | --$shortcode_atts['opt']; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | - $field_class = $shortcode_atts['class'] ?? ''; | |
| 390 | + $field_class = isset( $shortcode_atts['class'] ) ? $shortcode_atts['class'] : ''; | |
| 391 | 391 | $this->field_obj->set_field_column( 'input_class', $field_class ); |
| 392 | 392 | |
| 393 | 393 | if ( isset( $shortcode_atts['class'] ) ) { |
| 394 | 394 | unset( $shortcode_atts['class'] ); |
| @@ -523,13 +523,8 @@ | ||
| 523 | 523 | |
| 524 | 524 | // Add 'aria-required' attribute to the field if required. |
| 525 | 525 | if ( $is_radio && '1' === $field['required'] ) { |
| 526 | 526 | $attributes['aria-required'] = 'true'; |
| 527 | - } | |
| 528 | - | |
| 529 | - // Add 'aria-invalid' attribute to the group if there are errors. | |
| 530 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { | |
| 531 | - $attributes['aria-invalid'] = 'true'; | |
| 532 | 527 | } |
| 533 | 528 | |
| 534 | 529 | // Concatenate attributes into a string, and replace the role="group" in the HTML with the attributes string. |
| 535 | 530 | $html_attributes = FrmAppHelper::array_to_html_params( $attributes ); |