@@ -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 | if ( empty( $error ) ) { |
| 236 | 236 | return FrmShortcodeHelper::remove_inline_conditions( false, 'error', $error, $this->html ); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | * @since 3.06.02 |
| 280 | 280 | */ |
| 281 | 281 | private function maybe_add_error_id() { |
| 282 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 282 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 283 | 283 | return; |
| 284 | 284 | } |
| 285 | 285 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 360 | 360 | |
| 361 | 361 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 362 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 362 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 363 | 363 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 364 | 364 | |
| 365 | 365 | $replace_with = ''; |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 373 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | */ |
| 393 | 393 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 394 | 394 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 395 | - --$shortcode_atts['opt']; |
|
| 395 | + -- $shortcode_atts['opt']; |
|
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | private function get_field_div_classes() { |
| 458 | 458 | // Add error class |
| 459 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 459 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 460 | 460 | |
| 461 | 461 | // Add label position class |
| 462 | 462 | $settings = $this->field_obj->display_field_settings(); |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 538 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 538 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 539 | 539 | $attributes['aria-invalid'] = 'true'; |
| 540 | 540 | } |
| 541 | 541 | |