@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | * @param array $atts |
| 45 | 45 | */ |
| 46 | 46 | private function _set( $param, $atts ) { |
| 47 | - if ( isset( $atts[ $param ] ) ) { |
|
| 48 | - $this->{$param} = $atts[ $param ]; |
|
| 47 | + if ( isset( $atts[$param] ) ) { |
|
| 48 | + $this->{$param} = $atts[$param]; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | $exclude = array( 'field_obj', 'html' ); |
| 91 | 91 | foreach ( $exclude as $ex ) { |
| 92 | - if ( isset( $atts[ $ex ] ) ) { |
|
| 93 | - unset( $this->pass_args[ $ex ] ); |
|
| 92 | + if ( isset( $atts[$ex] ) ) { |
|
| 93 | + unset( $this->pass_args[$ex] ); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | * @param array $set |
| 103 | 103 | */ |
| 104 | 104 | private function set_from_field( $atts, $set ) { |
| 105 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
| 106 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
| 105 | + if ( isset( $atts[$set['param']] ) ) { |
|
| 106 | + $this->{$set['param']} = $atts[$set['param']]; |
|
| 107 | 107 | } else { |
| 108 | 108 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
| 109 | 109 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 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 = $this->pass_args['errors']['field' . $this->field_id] ?? false; |
|
| 234 | 234 | |
| 235 | 235 | $include_alert_role_on_field_errors = FrmAppHelper::should_include_alert_role_on_field_errors(); |
| 236 | 236 | $has_alert_role = false === strpos( $this->html, 'role="alert"' ); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * @since 3.06.02 |
| 276 | 276 | */ |
| 277 | 277 | private function maybe_add_error_id() { |
| 278 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 278 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 279 | 279 | return; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 356 | 356 | |
| 357 | 357 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 358 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 358 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 359 | 359 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 360 | 360 | |
| 361 | 361 | $replace_with = ''; |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 369 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | */ |
| 389 | 389 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 390 | 390 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 391 | - --$shortcode_atts['opt']; |
|
| 391 | + -- $shortcode_atts['opt']; |
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | */ |
| 453 | 453 | private function get_field_div_classes() { |
| 454 | 454 | // Add error class |
| 455 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 455 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 456 | 456 | |
| 457 | 457 | // Add label position class |
| 458 | 458 | $settings = $this->field_obj->display_field_settings(); |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 534 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 534 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 535 | 535 | $attributes['aria-invalid'] = 'true'; |
| 536 | 536 | } |
| 537 | 537 | |