@@ -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 | return FrmShortcodeHelper::remove_inline_conditions( false, 'error', $error, $this->html ); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | * @return void |
| 332 | 332 | */ |
| 333 | 333 | private function maybe_add_error_id() { |
| 334 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 334 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 335 | 335 | return; |
| 336 | 336 | } |
| 337 | 337 | |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
| 424 | 424 | |
| 425 | 425 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
| 426 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
| 426 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
| 427 | 427 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
| 428 | 428 | |
| 429 | 429 | $replace_with = ''; |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
| 437 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | */ |
| 457 | 457 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
| 458 | 458 | if ( isset( $shortcode_atts['opt'] ) ) { |
| 459 | - --$shortcode_atts['opt']; |
|
| 459 | + -- $shortcode_atts['opt']; |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | $field_class = $shortcode_atts['class'] ?? ''; |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | */ |
| 527 | 527 | private function get_field_div_classes() { |
| 528 | 528 | // Add error class |
| 529 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
| 529 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
| 530 | 530 | |
| 531 | 531 | // Add label position class |
| 532 | 532 | $settings = $this->field_obj->display_field_settings(); |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | // Add 'aria-invalid' attribute to the group if there are errors. |
| 611 | - if ( isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
| 611 | + if ( isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
| 612 | 612 | $attributes['aria-invalid'] = 'true'; |
| 613 | 613 | } |
| 614 | 614 | |