@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $intent_is_processing = 'processing' === $intent->status; |
58 | 58 | if ( $intent_is_processing ) { |
59 | 59 | // Append an additional processing message to the end of the success message. |
60 | - $filter = function ( $message ) { |
|
60 | + $filter = function( $message ) { |
|
61 | 61 | $stripe_settings = FrmStrpLiteAppHelper::get_settings(); |
62 | 62 | $message .= '<p>' . esc_html( $stripe_settings->settings->processing_message ) . '</p>'; |
63 | 63 | return $message; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $atts['form'] = FrmForm::getOne( $atts['entry']->form_id ); |
162 | 162 | $atts['entry_id'] = $atts['entry']->id; |
163 | 163 | $opt = 'success_action'; |
164 | - $atts['conf_method'] = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
164 | + $atts['conf_method'] = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
165 | 165 | |
166 | 166 | $actions = FrmFormsController::get_met_on_submit_actions( $atts, 'create' ); |
167 | 167 | if ( $actions ) { |
@@ -246,10 +246,10 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public static function get_payment_intents( $name ) { |
248 | 248 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
249 | - if ( ! isset( $_POST[ $name ] ) ) { |
|
249 | + if ( ! isset( $_POST[$name] ) ) { |
|
250 | 250 | return array(); |
251 | 251 | } |
252 | - $intents = $_POST[ $name ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
252 | + $intents = $_POST[$name]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
|
253 | 253 | FrmAppHelper::sanitize_value( 'sanitize_text_field', $intents ); |
254 | 254 | return $intents; |
255 | 255 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | self::format_form_data( $form ); |
277 | 277 | |
278 | 278 | $form_id = absint( $form['form_id'] ); |
279 | - $intents = isset( $form[ 'frmintent' . $form_id ] ) ? $form[ 'frmintent' . $form_id ] : array(); |
|
279 | + $intents = isset( $form['frmintent' . $form_id] ) ? $form['frmintent' . $form_id] : array(); |
|
280 | 280 | |
281 | 281 | if ( empty( $intents ) ) { |
282 | 282 | wp_die(); |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | $intents = array( $intents ); |
287 | 287 | } else { |
288 | 288 | foreach ( $intents as $k => $intent ) { |
289 | - if ( is_array( $intent ) && isset( $intent[ $k ] ) ) { |
|
290 | - $intents[ $k ] = $intent[ $k ]; |
|
289 | + if ( is_array( $intent ) && isset( $intent[$k] ) ) { |
|
290 | + $intents[$k] = $intent[$k]; |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | if ( $saved->metadata->action != $action->ID ) { |
341 | 341 | continue; |
342 | 342 | } |
343 | - $intents[ $k ] = array( |
|
343 | + $intents[$k] = array( |
|
344 | 344 | 'id' => $intent, |
345 | 345 | 'action' => $action->ID, |
346 | 346 | ); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if ( $k === 'item_meta' ) { |
384 | 384 | foreach ( $v as $f => $value ) { |
385 | 385 | FrmAppHelper::sanitize_value( 'wp_kses_post', $value ); |
386 | - $entry->metas[ absint( $f ) ] = $value; |
|
386 | + $entry->metas[absint( $f )] = $value; |
|
387 | 387 | } |
388 | 388 | } else { |
389 | 389 | FrmAppHelper::sanitize_value( 'wp_kses_post', $v ); |
@@ -407,14 +407,14 @@ discard block |
||
407 | 407 | |
408 | 408 | foreach ( $form as $input ) { |
409 | 409 | $key = $input['name']; |
410 | - if ( isset( $formatted[ $key ] ) ) { |
|
411 | - if ( is_array( $formatted[ $key ] ) ) { |
|
412 | - $formatted[ $key ][] = $input['value']; |
|
410 | + if ( isset( $formatted[$key] ) ) { |
|
411 | + if ( is_array( $formatted[$key] ) ) { |
|
412 | + $formatted[$key][] = $input['value']; |
|
413 | 413 | } else { |
414 | - $formatted[ $key ] = array( $formatted[ $key ], $input['value'] ); |
|
414 | + $formatted[$key] = array( $formatted[$key], $input['value'] ); |
|
415 | 415 | } |
416 | 416 | } else { |
417 | - $formatted[ $key ] = $input['value']; |
|
417 | + $formatted[$key] = $input['value']; |
|
418 | 418 | } |
419 | 419 | } |
420 | 420 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | |
560 | 560 | foreach ( $actions as $k => $action ) { |
561 | 561 | $amount = self::get_amount_before_submit( compact( 'action', 'form' ) ); |
562 | - $actions[ $k ]->post_content['amount'] = $amount; |
|
562 | + $actions[$k]->post_content['amount'] = $amount; |
|
563 | 563 | } |
564 | 564 | } |
565 | 565 |
@@ -239,8 +239,8 @@ discard block |
||
239 | 239 | } |
240 | 240 | |
241 | 241 | foreach ( $settings as $setting => $default ) { |
242 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
243 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
242 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
243 | + $this->{$setting} = $params['frm_' . $setting]; |
|
244 | 244 | } elseif ( ! isset( $this->{$setting} ) ) { |
245 | 245 | $this->{$setting} = $default; |
246 | 246 | } |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | 'denylist_check', |
433 | 433 | ); |
434 | 434 | foreach ( $checkboxes as $set ) { |
435 | - $this->$set = isset( $params[ 'frm_' . $set ] ) ? absint( $params[ 'frm_' . $set ] ) : 0; |
|
435 | + $this->$set = isset( $params['frm_' . $set] ) ? absint( $params['frm_' . $set] ) : 0; |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $frm_roles = FrmAppHelper::frm_capabilities(); |
446 | 446 | $roles = get_editable_roles(); |
447 | 447 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
448 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
448 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
449 | 449 | |
450 | 450 | // Make sure administrators always have permissions |
451 | 451 | if ( ! in_array( 'administrator', $this->$frm_role, true ) ) { |
@@ -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 | |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | printf( |
638 | 638 | /* translators: %s: Field type */ |
639 | 639 | esc_html__( '%s Options', 'formidable' ), |
640 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
640 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
641 | 641 | ); |
642 | 642 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); |
643 | 643 | ?> |
@@ -737,7 +737,7 @@ discard block |
||
737 | 737 | * New field |
738 | 738 | */ |
739 | 739 | public function get_new_field_defaults() { |
740 | - $field = array( |
|
740 | + $field = array( |
|
741 | 741 | 'name' => $this->get_new_field_name(), |
742 | 742 | 'description' => '', |
743 | 743 | 'type' => $this->type, |
@@ -768,8 +768,8 @@ discard block |
||
768 | 768 | |
769 | 769 | $fields = array_merge( $fields, $pro_fields ); |
770 | 770 | |
771 | - if ( isset( $fields[ $this->type ] ) ) { |
|
772 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
771 | + if ( isset( $fields[$this->type] ) ) { |
|
772 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
773 | 773 | } |
774 | 774 | |
775 | 775 | return $name; |
@@ -786,7 +786,7 @@ discard block |
||
786 | 786 | * @return array |
787 | 787 | */ |
788 | 788 | public function get_default_field_options() { |
789 | - $opts = array( |
|
789 | + $opts = array( |
|
790 | 790 | 'size' => '', |
791 | 791 | 'max' => '', |
792 | 792 | 'label' => '', |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | * @return void |
1031 | 1031 | */ |
1032 | 1032 | public function set_aria_invalid_error( &$shortcode_atts, $args ) { |
1033 | - $shortcode_atts['aria-invalid'] = isset( $args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
1033 | + $shortcode_atts['aria-invalid'] = isset( $args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | /** |
@@ -1181,11 +1181,11 @@ discard block |
||
1181 | 1181 | } |
1182 | 1182 | |
1183 | 1183 | $options = array_values( $this->field['options'] ); |
1184 | - if ( ! isset( $options[ $opt ] ) ) { |
|
1184 | + if ( ! isset( $options[$opt] ) ) { |
|
1185 | 1185 | return $hidden; |
1186 | 1186 | } |
1187 | 1187 | |
1188 | - $option = $options[ $opt ]; |
|
1188 | + $option = $options[$opt]; |
|
1189 | 1189 | if ( is_array( $option ) ) { |
1190 | 1190 | $option = $option['value']; |
1191 | 1191 | } |
@@ -1249,8 +1249,8 @@ discard block |
||
1249 | 1249 | $selected = $values['field_value']; |
1250 | 1250 | |
1251 | 1251 | if ( isset( $values['combo_name'] ) ) { |
1252 | - $options = $options[ $values['combo_name'] ]; |
|
1253 | - $selected = is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ? $selected[ $values['combo_name'] ] : ''; |
|
1252 | + $options = $options[$values['combo_name']]; |
|
1253 | + $selected = is_array( $selected ) && isset( $selected[$values['combo_name']] ) ? $selected[$values['combo_name']] : ''; |
|
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | $input = $this->select_tag( $values ); |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | } |
1306 | 1306 | |
1307 | 1307 | protected function fill_display_field_values( $args = array() ) { |
1308 | - $defaults = array( |
|
1308 | + $defaults = array( |
|
1309 | 1309 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1310 | 1310 | 'field_id' => $this->get_field_column( 'id' ), |
1311 | 1311 | 'field_plus_id' => '', |
@@ -1362,7 +1362,7 @@ discard block |
||
1362 | 1362 | } |
1363 | 1363 | } |
1364 | 1364 | |
1365 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1365 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1366 | 1366 | if ( $error_comes_first ) { |
1367 | 1367 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1368 | 1368 | } else { |
@@ -1440,11 +1440,11 @@ discard block |
||
1440 | 1440 | |
1441 | 1441 | $field_id = $this->get_field_column( 'id' ); |
1442 | 1442 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1443 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1443 | + $frm_validated_unique_values[$field_id] = array(); |
|
1444 | 1444 | return false; |
1445 | 1445 | } |
1446 | 1446 | |
1447 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1447 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1448 | 1448 | return $already_validated_this_value; |
1449 | 1449 | } |
1450 | 1450 | |
@@ -1469,7 +1469,7 @@ discard block |
||
1469 | 1469 | private function value_validated_as_unique( $value ) { |
1470 | 1470 | global $frm_validated_unique_values; |
1471 | 1471 | $field_id = $this->get_field_column( 'id' ); |
1472 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1472 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1473 | 1473 | } |
1474 | 1474 | |
1475 | 1475 | /** |
@@ -1514,8 +1514,8 @@ discard block |
||
1514 | 1514 | $value = $this->prepare_display_value( $value, $atts ); |
1515 | 1515 | |
1516 | 1516 | if ( is_array( $value ) ) { |
1517 | - if ( ! empty( $atts['show'] ) && isset( $value[ $atts['show'] ] ) ) { |
|
1518 | - $value = $value[ $atts['show'] ]; |
|
1517 | + if ( ! empty( $atts['show'] ) && isset( $value[$atts['show']] ) ) { |
|
1518 | + $value = $value[$atts['show']]; |
|
1519 | 1519 | } elseif ( empty( $atts['return_array'] ) ) { |
1520 | 1520 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1521 | 1521 | $value = FrmAppHelper::safe_implode( $sep, $value ); |
@@ -1645,8 +1645,8 @@ discard block |
||
1645 | 1645 | $saved_entries = $atts['ids']; |
1646 | 1646 | $new_value = array(); |
1647 | 1647 | foreach ( (array) $value as $old_child_id ) { |
1648 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1649 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1648 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1649 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1650 | 1650 | } |
1651 | 1651 | } |
1652 | 1652 |