@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $event_labels = FrmFormAction::trigger_labels(); |
| 44 | 44 | foreach ( $action_control->action_options['event'] as $event ) { |
| 45 | 45 | ?> |
| 46 | - <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[ $event ] ?? $event ); ?></option> |
|
| 46 | + <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( $event_labels[$event] ?? $event ); ?></option> |
|
| 47 | 47 | <?php } ?> |
| 48 | 48 | </select> |
| 49 | 49 | </p> |
@@ -40,14 +40,14 @@ discard block |
||
| 40 | 40 | ?> |
| 41 | 41 | <p class="frm6 frm_form_field"> |
| 42 | 42 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 43 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 43 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 44 | 44 | </label> |
| 45 | 45 | <span class="frm-with-right-icon"> |
| 46 | 46 | <input |
| 47 | 47 | type="text" |
| 48 | 48 | name="<?php echo esc_attr( $input_name ); ?>" |
| 49 | 49 | id="<?php echo esc_attr( $input_id ); ?>" |
| 50 | - value="<?php echo esc_attr( $default_value[ $sub_field['name'] ] ?? '' ); ?>" |
|
| 50 | + value="<?php echo esc_attr( $default_value[$sub_field['name']] ?? '' ); ?>" |
|
| 51 | 51 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
| 52 | 52 | data-changeatt="value" |
| 53 | 53 | /> |
@@ -73,13 +73,13 @@ discard block |
||
| 73 | 73 | ?> |
| 74 | 74 | <p class="frm6 frm_form_field"> |
| 75 | 75 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 76 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 76 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 77 | 77 | </label> |
| 78 | 78 | <input |
| 79 | 79 | type="text" |
| 80 | 80 | name="<?php echo esc_attr( $input_name ); ?>" |
| 81 | 81 | id="<?php echo esc_attr( $input_id ); ?>" |
| 82 | - value="<?php echo esc_attr( $input_value[ $sub_field['name'] ] ?? '' ); ?>" |
|
| 82 | + value="<?php echo esc_attr( $input_value[$sub_field['name']] ?? '' ); ?>" |
|
| 83 | 83 | data-changeme="field_<?php echo esc_attr( $field_key . '_' . $sub_field['name'] ); ?>" |
| 84 | 84 | data-changeatt="<?php echo esc_attr( $option ); ?>" |
| 85 | 85 | /> |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | ?> |
| 96 | 96 | <p class="frm_form_field frm-flex-col"> |
| 97 | 97 | <label class="frm_description" for="<?php echo esc_attr( $input_id ); ?>"> |
| 98 | - <?php echo esc_html( $labels[ $option ] ); ?> |
|
| 98 | + <?php echo esc_html( $labels[$option] ); ?> |
|
| 99 | 99 | </label> |
| 100 | 100 | <textarea |
| 101 | 101 | name="<?php echo esc_attr( $input_name ); ?>" |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $sub_field_class = "frm_form_field form-field frm_form_subfield-{$name} {$sub_field['wrapper_classes']}"; |
| 42 | 42 | $sub_field_desc = FrmField::get_option( $field, $name . '_desc' ); |
| 43 | 43 | |
| 44 | - if ( isset( $errors[ 'field' . $field_id . '-' . $name ] ) ) { |
|
| 44 | + if ( isset( $errors['field' . $field_id . '-' . $name] ) ) { |
|
| 45 | 45 | $sub_field_class .= ' frm_blank_field'; |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | $attrs = array( |
| 61 | 61 | 'type' => $sub_field['type'], |
| 62 | 62 | 'id' => $html_id . '_' . $name, |
| 63 | - 'value' => $field_value[ $name ] ?? '', |
|
| 63 | + 'value' => $field_value[$name] ?? '', |
|
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - if ( ! empty( $field_value[ $name ] ) ) { |
|
| 67 | - $attrs['data-frmval'] = $field_value[ $name ]; |
|
| 66 | + if ( ! empty( $field_value[$name] ) ) { |
|
| 67 | + $attrs['data-frmval'] = $field_value[$name]; |
|
| 68 | 68 | } |
| 69 | 69 | if ( empty( $args['remove_names'] ) ) { |
| 70 | 70 | $attrs['name'] = $field_name . '[' . $name . ']'; |
@@ -81,9 +81,9 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Don't show individual field errors when there is a combo field error. |
| 84 | - if ( ! empty( $errors ) && isset( $errors[ 'field' . $field_id . '-' . $name ] ) && ! isset( $errors[ 'field' . $field_id ] ) ) { |
|
| 84 | + if ( ! empty( $errors ) && isset( $errors['field' . $field_id . '-' . $name] ) && ! isset( $errors['field' . $field_id] ) ) { |
|
| 85 | 85 | ?> |
| 86 | - <div class="frm_error" role="alert"><?php echo esc_html( $errors[ 'field' . $field_id . '-' . $name ] ); ?></div> |
|
| 86 | + <div class="frm_error" role="alert"><?php echo esc_html( $errors['field' . $field_id . '-' . $name] ); ?></div> |
|
| 87 | 87 | <?php } ?> |
| 88 | 88 | </div> |
| 89 | 89 | <?php |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $info['url'] = $xml; |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - $disabled = isset( $imported[ $info['form'] ] ) ? ' disabled' : ''; |
|
| 14 | + $disabled = isset( $imported[$info['form']] ) ? ' disabled' : ''; |
|
| 15 | 15 | $url = $info['url'] ?? ''; |
| 16 | 16 | $value = $importing === 'form' ? $info['form'] : $info['key']; |
| 17 | 17 | if ( ! isset( $info['img'] ) ) { |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | continue; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[ $info['form'] ] ) ); |
|
| 24 | + $hide_views = $importing === 'view' && ( ( $selected && $info['form'] !== $selected ) || isset( $imported[$info['form']] ) ); |
|
| 25 | 25 | ?> |
| 26 | 26 | <div class="frm_radio radio-inline radio frm_image_option<?php echo esc_attr( $importing === 'view' ? ' show_sub_opt show_' . $info['form'] : '' ); ?>" style="<?php echo esc_attr( $hide_views ? 'display:none' : '' ); ?>"> |
| 27 | 27 | <?php if ( $importing === 'form' ) { ?> |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ( $importing === 'form' && $disabled ) { |
| 57 | - FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[ $info['form'] ] ), array( 'a' ) ); |
|
| 57 | + FrmAppHelper::kses_echo( FrmFormsHelper::edit_form_link( $imported[$info['form']] ), array( 'a' ) ); |
|
| 58 | 58 | } else { |
| 59 | 59 | echo esc_html( $info['name'] ); |
| 60 | 60 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | FrmFieldGdprHelper::FIELD_TYPE => FrmFieldGdprHelper::get_gdpr_field_class( $field_type ), |
| 113 | 113 | ); |
| 114 | 114 | |
| 115 | - $class = $type_classes[ $field_type ] ?? ''; |
|
| 115 | + $class = $type_classes[$field_type] ?? ''; |
|
| 116 | 116 | |
| 117 | 117 | return apply_filters( 'frm_get_field_type_class', $class, $field_type ); |
| 118 | 118 | } |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | protected function get_field_value( $args ) { |
| 59 | 59 | $user_ID = get_current_user_id(); |
| 60 | 60 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 61 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 61 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 62 | 62 | $action = ( $args['action'] ?? $args['form_action'] ?? '' ); |
| 63 | 63 | $updating = $action === 'update'; |
| 64 | 64 | return is_numeric( $this->field['value'] ) || $posted_value || $updating ? $this->field['value'] : $user_ID; |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | $field_val = ''; |
| 157 | 157 | if ( is_object( $this->field ) ) { |
| 158 | 158 | $field_val = $this->field->{$column}; |
| 159 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
| 160 | - $field_val = $this->field[ $column ]; |
|
| 159 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
| 160 | + $field_val = $this->field[$column]; |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | return $field_val; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | if ( is_object( $this->field ) ) { |
| 172 | 172 | $this->field->{$column} = $value; |
| 173 | 173 | } elseif ( is_array( $this->field ) ) { |
| 174 | - $this->field[ $column ] = $value; |
|
| 174 | + $this->field[$column] = $value; |
|
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | printf( |
| 652 | 652 | /* translators: %s: Field type */ |
| 653 | 653 | esc_html__( '%s Options', 'formidable' ), |
| 654 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
| 654 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
| 655 | 655 | ); |
| 656 | 656 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) ); |
| 657 | 657 | ?> |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | * New field |
| 752 | 752 | */ |
| 753 | 753 | public function get_new_field_defaults() { |
| 754 | - $field = array( |
|
| 754 | + $field = array( |
|
| 755 | 755 | 'name' => $this->get_new_field_name(), |
| 756 | 756 | 'description' => '', |
| 757 | 757 | 'type' => $this->type, |
@@ -782,8 +782,8 @@ discard block |
||
| 782 | 782 | |
| 783 | 783 | $fields = array_merge( $fields, $pro_fields ); |
| 784 | 784 | |
| 785 | - if ( isset( $fields[ $this->type ] ) ) { |
|
| 786 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
| 785 | + if ( isset( $fields[$this->type] ) ) { |
|
| 786 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | return $name; |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | * @return array |
| 801 | 801 | */ |
| 802 | 802 | public function get_default_field_options() { |
| 803 | - $opts = array( |
|
| 803 | + $opts = array( |
|
| 804 | 804 | 'size' => '', |
| 805 | 805 | 'max' => '', |
| 806 | 806 | 'label' => '', |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | * @return void |
| 1045 | 1045 | */ |
| 1046 | 1046 | public function set_aria_invalid_error( &$shortcode_atts, $args ) { |
| 1047 | - $shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
| 1047 | + $shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | /** |
@@ -1204,11 +1204,11 @@ discard block |
||
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | 1206 | $options = array_values( $this->field['options'] ); |
| 1207 | - if ( ! isset( $options[ $opt ] ) ) { |
|
| 1207 | + if ( ! isset( $options[$opt] ) ) { |
|
| 1208 | 1208 | return $hidden; |
| 1209 | 1209 | } |
| 1210 | 1210 | |
| 1211 | - $option = $options[ $opt ]; |
|
| 1211 | + $option = $options[$opt]; |
|
| 1212 | 1212 | if ( is_array( $option ) ) { |
| 1213 | 1213 | $option = $option['value']; |
| 1214 | 1214 | } |
@@ -1272,8 +1272,8 @@ discard block |
||
| 1272 | 1272 | $selected = $values['field_value']; |
| 1273 | 1273 | |
| 1274 | 1274 | if ( isset( $values['combo_name'] ) ) { |
| 1275 | - $options = $options[ $values['combo_name'] ]; |
|
| 1276 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
| 1275 | + $options = $options[$values['combo_name']]; |
|
| 1276 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | $input = $this->select_tag( $values ); |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | } |
| 1329 | 1329 | |
| 1330 | 1330 | protected function fill_display_field_values( $args = array() ) { |
| 1331 | - $defaults = array( |
|
| 1331 | + $defaults = array( |
|
| 1332 | 1332 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
| 1333 | 1333 | 'field_id' => $this->get_field_column( 'id' ), |
| 1334 | 1334 | 'field_plus_id' => '', |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | } |
| 1386 | 1386 | } |
| 1387 | 1387 | |
| 1388 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
| 1388 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
| 1389 | 1389 | if ( $error_comes_first ) { |
| 1390 | 1390 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
| 1391 | 1391 | } else { |
@@ -1463,11 +1463,11 @@ discard block |
||
| 1463 | 1463 | |
| 1464 | 1464 | $field_id = $this->get_field_column( 'id' ); |
| 1465 | 1465 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
| 1466 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
| 1466 | + $frm_validated_unique_values[$field_id] = array(); |
|
| 1467 | 1467 | return false; |
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
| 1470 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
| 1471 | 1471 | return $already_validated_this_value; |
| 1472 | 1472 | } |
| 1473 | 1473 | |
@@ -1492,7 +1492,7 @@ discard block |
||
| 1492 | 1492 | private function value_validated_as_unique( $value ) { |
| 1493 | 1493 | global $frm_validated_unique_values; |
| 1494 | 1494 | $field_id = $this->get_field_column( 'id' ); |
| 1495 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
| 1495 | + $frm_validated_unique_values[$field_id][] = $value; |
|
| 1496 | 1496 | } |
| 1497 | 1497 | |
| 1498 | 1498 | /** |
@@ -1537,8 +1537,8 @@ discard block |
||
| 1537 | 1537 | $value = $this->prepare_display_value( $value, $atts ); |
| 1538 | 1538 | |
| 1539 | 1539 | if ( is_array( $value ) ) { |
| 1540 | - if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) { |
|
| 1541 | - $value = $value[ $atts['show'] ]; |
|
| 1540 | + if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) { |
|
| 1541 | + $value = $value[$atts['show']]; |
|
| 1542 | 1542 | } elseif ( empty( $atts['return_array'] ) ) { |
| 1543 | 1543 | $sep = $atts['sep'] ?? ', '; |
| 1544 | 1544 | $value = FrmAppHelper::safe_implode( $sep, $value ); |
@@ -1668,8 +1668,8 @@ discard block |
||
| 1668 | 1668 | $saved_entries = $atts['ids']; |
| 1669 | 1669 | $new_value = array(); |
| 1670 | 1670 | foreach ( (array) $value as $old_child_id ) { |
| 1671 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
| 1672 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
| 1671 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
| 1672 | + $new_value[] = $saved_entries[$old_child_id]; |
|
| 1673 | 1673 | } |
| 1674 | 1674 | } |
| 1675 | 1675 | |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | if ( is_array( $sub_field ) ) { |
| 62 | 62 | $sub_field = wp_parse_args( $sub_field, $defaults ); |
| 63 | 63 | $sub_field['name'] = $name; |
| 64 | - $this->sub_fields[ $name ] = $sub_field; |
|
| 64 | + $this->sub_fields[$name] = $sub_field; |
|
| 65 | 65 | continue; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if ( is_string( $sub_field ) ) { |
| 69 | - $this->sub_fields[ $name ] = wp_parse_args( |
|
| 69 | + $this->sub_fields[$name] = wp_parse_args( |
|
| 70 | 70 | array( |
| 71 | 71 | 'name' => $name, |
| 72 | 72 | 'label' => $sub_field, |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function set_aria_invalid_error( &$shortcode_atts, $args ) { |
| 91 | 91 | foreach ( $this->get_sub_fields() as $sub_field ) { |
| 92 | - $shortcode_atts[ 'aria-invalid-' . $sub_field['name'] ] = isset( $args['errors'][ 'field' . $this->field_id . '-' . $sub_field['name'] ] ) ? 'true' : 'false'; |
|
| 92 | + $shortcode_atts['aria-invalid-' . $sub_field['name']] = isset( $args['errors']['field' . $this->field_id . '-' . $sub_field['name']] ) ? 'true' : 'false'; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | if ( is_string( $option ) ) { |
| 138 | - $extra_options[ $key . '_' . $option ] = ''; |
|
| 138 | + $extra_options[$key . '_' . $option] = ''; |
|
| 139 | 139 | } elseif ( ! empty( $option['name'] ) ) { |
| 140 | - $extra_options[ $key . '_' . $option['name'] ] = ''; |
|
| 140 | + $extra_options[$key . '_' . $option['name']] = ''; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | foreach ( $this->sub_fields as $name => $sub_field ) { |
| 164 | 164 | $sub_field['name'] = $name; |
| 165 | 165 | $wrapper_classes = 'frm_grid_container frm_sub_field_options frm_sub_field_options-' . $sub_field['name']; |
| 166 | - if ( ! isset( $processed_sub_fields[ $name ] ) ) { |
|
| 166 | + if ( ! isset( $processed_sub_fields[$name] ) ) { |
|
| 167 | 167 | // Options for this subfield should be hidden. |
| 168 | 168 | $wrapper_classes .= ' frm_hidden'; |
| 169 | 169 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $default_value = array(); |
| 194 | 194 | |
| 195 | 195 | foreach ( $this->sub_fields as $name => $sub_field ) { |
| 196 | - $default_value[ $name ] = ''; |
|
| 196 | + $default_value[$name] = ''; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | return $default_value; |
@@ -375,8 +375,8 @@ discard block |
||
| 375 | 375 | // Placeholder. |
| 376 | 376 | if ( in_array( 'placeholder', $sub_field['options'], true ) ) { |
| 377 | 377 | $placeholders = FrmField::get_option( $field, 'placeholder' ); |
| 378 | - if ( ! empty( $placeholders[ $sub_field['name'] ] ) ) { |
|
| 379 | - $field['placeholder'] = $placeholders[ $sub_field['name'] ]; |
|
| 378 | + if ( ! empty( $placeholders[$sub_field['name']] ) ) { |
|
| 379 | + $field['placeholder'] = $placeholders[$sub_field['name']]; |
|
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | |
@@ -437,9 +437,9 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | // Validate not empty. |
| 439 | 439 | foreach ( $sub_fields as $name => $sub_field ) { |
| 440 | - if ( empty( $sub_field['optional'] ) && empty( $args['value'][ $name ] ) ) { |
|
| 441 | - $errors[ 'field' . $args['id'] . '-' . $name ] = ''; |
|
| 442 | - $errors[ 'field' . $args['id'] ] = $blank_msg; |
|
| 440 | + if ( empty( $sub_field['optional'] ) && empty( $args['value'][$name] ) ) { |
|
| 441 | + $errors['field' . $args['id'] . '-' . $name] = ''; |
|
| 442 | + $errors['field' . $args['id']] = $blank_msg; |
|
| 443 | 443 | } |
| 444 | 444 | } |
| 445 | 445 | |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | $field_key = $this->field->field_key ?? $this->field['field_key']; |
| 459 | 459 | $sub_fields = $this->get_processed_sub_fields(); |
| 460 | 460 | foreach ( $sub_fields as $name => $sub_field ) { |
| 461 | - $headings[ $field_id . '_' . $name ] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
| 461 | + $headings[$field_id . '_' . $name] = $field_name . ' (' . $field_key . ') - ' . $sub_field['label']; |
|
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | return $headings; |
@@ -58,19 +58,19 @@ discard block |
||
| 58 | 58 | $result = array(); |
| 59 | 59 | |
| 60 | 60 | foreach ( $names as $name ) { |
| 61 | - if ( empty( $this->sub_fields[ $name ] ) ) { |
|
| 61 | + if ( empty( $this->sub_fields[$name] ) ) { |
|
| 62 | 62 | continue; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if ( ! isset( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
| 66 | - $this->sub_fields[ $name ]['wrapper_classes'] = $col_class; |
|
| 67 | - } elseif ( is_array( $this->sub_fields[ $name ]['wrapper_classes'] ) ) { |
|
| 68 | - $this->sub_fields[ $name ]['wrapper_classes'] = implode( ' ', $this->sub_fields[ $name ]['wrapper_classes'] ) . ' ' . $col_class; |
|
| 65 | + if ( ! isset( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
| 66 | + $this->sub_fields[$name]['wrapper_classes'] = $col_class; |
|
| 67 | + } elseif ( is_array( $this->sub_fields[$name]['wrapper_classes'] ) ) { |
|
| 68 | + $this->sub_fields[$name]['wrapper_classes'] = implode( ' ', $this->sub_fields[$name]['wrapper_classes'] ) . ' ' . $col_class; |
|
| 69 | 69 | } else { |
| 70 | - $this->sub_fields[ $name ]['wrapper_classes'] .= ' ' . $col_class; |
|
| 70 | + $this->sub_fields[$name]['wrapper_classes'] .= ' ' . $col_class; |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $result[ $name ] = $this->sub_fields[ $name ]; |
|
| 73 | + $result[$name] = $this->sub_fields[$name]; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $result; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | // Default desc. |
| 103 | 103 | foreach ( $this->sub_fields as $name => $sub_field ) { |
| 104 | - $extra_options[ $name . '_desc' ] = $sub_field['label']; |
|
| 104 | + $extra_options[$name . '_desc'] = $sub_field['label']; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return $extra_options; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $name_layout = $this->get_name_layout(); |
| 140 | 140 | |
| 141 | 141 | if ( ! empty( $atts['show'] ) ) { |
| 142 | - return $value[ $atts['show'] ] ?? ''; |
|
| 142 | + return $value[$atts['show']] ?? ''; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $value = wp_parse_args( |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $args['sub_fields'] = $this->sub_fields; |
| 217 | 217 | |
| 218 | 218 | foreach ( $hidden_fields as $name => $hidden_field ) { |
| 219 | - $args['sub_fields'][ $name ]['wrapper_classes'] .= ' frm_hidden'; |
|
| 219 | + $args['sub_fields'][$name]['wrapper_classes'] .= ' frm_hidden'; |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | } |