@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | * @return void |
| 62 | 62 | */ |
| 63 | 63 | private function _set( $param, $atts ) { |
| 64 | - if ( isset( $atts[ $param ] ) ) { |
|
| 65 | - $this->{$param} = $atts[ $param ]; |
|
| 64 | + if ( isset( $atts[$param] ) ) { |
|
| 65 | + $this->{$param} = $atts[$param]; |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | $exclude = array( 'field_obj', 'html' ); |
| 114 | 114 | foreach ( $exclude as $ex ) { |
| 115 | - if ( isset( $atts[ $ex ] ) ) { |
|
| 116 | - unset( $this->pass_args[ $ex ] ); |
|
| 115 | + if ( isset( $atts[$ex] ) ) { |
|
| 116 | + unset( $this->pass_args[$ex] ); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | * @return void |
| 128 | 128 | */ |
| 129 | 129 | private function set_from_field( $atts, $set ) { |
| 130 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
| 131 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
| 130 | + if ( isset( $atts[$set['param']] ) ) { |
|
| 131 | + $this->{$set['param']} = $atts[$set['param']]; |
|
| 132 | 132 | } else { |
| 133 | 133 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
| 134 | 134 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | private function replace_error_shortcode() { |
| 281 | 281 | $this->maybe_add_error_id(); |
| 282 | - $error = $this->pass_args['errors'][ 'field' . $this->field_id ] ?? false; |
|
| 282 | + $error = $this->pass_args['errors']['field' . $this->field_id] ?? false; |
|
| 283 | 283 | |
| 284 | 284 | if ( empty( $error ) ) { |
| 285 | 285 | FrmShortcodeHelper::remove_inline_conditions( false, 'error', $error, $this->html ); |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | * @return void |
| 335 | 335 | */ |
| 336 | 336 | private function maybe_add_error_id() { |
| 337 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 337 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 338 | 338 | return; |
| 339 | 339 | } |
| 340 | 340 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 427 | 427 | |
| 428 | 428 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 429 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 429 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 430 | 430 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 431 | 431 | |
| 432 | 432 | $replace_with = ''; |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 440 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 441 | 441 | } |
| 442 | 442 | } |
| 443 | 443 | |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 461 | 461 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 462 | - --$shortcode_atts['opt']; |
|
| 462 | + -- $shortcode_atts['opt']; |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | */ |
| 530 | 530 | private function get_field_div_classes() { |
| 531 | 531 | // Add error class |
| 532 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 532 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 533 | 533 | |
| 534 | 534 | // Add label position class |
| 535 | 535 | $settings = $this->field_obj->display_field_settings(); |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 614 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 614 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 615 | 615 | $attributes['aria-invalid'] = 'true'; |
| 616 | 616 | } |
| 617 | 617 | |