@@ -164,8 +164,8 @@ discard block |
||
164 | 164 | |
165 | 165 | $conditionally_add = array( 'include_fields', 'fields', 'exclude_fields', 'entry' ); |
166 | 166 | foreach ( $conditionally_add as $index ) { |
167 | - if ( isset( $atts[ $index ] ) ) { |
|
168 | - $entry_atts[ $index ] = $atts[ $index ]; |
|
167 | + if ( isset( $atts[$index] ) ) { |
|
168 | + $entry_atts[$index] = $atts[$index]; |
|
169 | 169 | } |
170 | 170 | } |
171 | 171 | |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | |
352 | 352 | $unset = array( 'id', 'form_id', 'format' ); |
353 | 353 | foreach ( $unset as $param ) { |
354 | - if ( isset( $atts[ $param ] ) ) { |
|
355 | - unset( $atts[ $param ] ); |
|
354 | + if ( isset( $atts[$param] ) ) { |
|
355 | + unset( $atts[$param] ); |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | |
@@ -523,11 +523,11 @@ discard block |
||
523 | 523 | |
524 | 524 | $displayed_value = $this->prepare_display_value_for_array( $field_value->get_displayed_value() ); |
525 | 525 | |
526 | - $output[ $this->get_key_or_id( $field_value ) ] = $displayed_value; |
|
526 | + $output[$this->get_key_or_id( $field_value )] = $displayed_value; |
|
527 | 527 | |
528 | 528 | $has_separate_value = (bool) $field_value->get_field_option( 'separate_value' ); |
529 | 529 | if ( $has_separate_value || $displayed_value !== $field_value->get_saved_value() ) { |
530 | - $output[ $this->get_key_or_id( $field_value ) . '-value' ] = $field_value->get_saved_value(); |
|
530 | + $output[$this->get_key_or_id( $field_value ) . '-value'] = $field_value->get_saved_value(); |
|
531 | 531 | } |
532 | 532 | } |
533 | 533 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | |
918 | 918 | if ( is_array( $value ) ) { |
919 | 919 | foreach ( $value as $key => $single_value ) { |
920 | - $value[ $key ] = $this->strip_html( $single_value ); |
|
920 | + $value[$key] = $this->strip_html( $single_value ); |
|
921 | 921 | } |
922 | 922 | } elseif ( $this->is_plain_text && ! is_array( $value ) ) { |
923 | 923 | if ( strpos( $value, '<img' ) !== false ) { |
@@ -330,11 +330,11 @@ discard block |
||
330 | 330 | |
331 | 331 | // Perform add or remove operation. |
332 | 332 | if ( 'add' === $operation ) { |
333 | - self::$favorite_templates[ $key ][] = $template_id; |
|
333 | + self::$favorite_templates[$key][] = $template_id; |
|
334 | 334 | } elseif ( 'remove' === $operation ) { |
335 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
335 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
336 | 336 | if ( $position !== false ) { |
337 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
337 | + unset( self::$favorite_templates[$key][$position] ); |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | foreach ( self::$templates as $key => &$template ) { |
464 | 464 | // Skip the template if the categories are not set. |
465 | 465 | if ( ! isset( $template['categories'] ) ) { |
466 | - unset( self::$templates[ $key ] ); |
|
466 | + unset( self::$templates[$key] ); |
|
467 | 467 | continue; |
468 | 468 | } |
469 | 469 | |
@@ -477,14 +477,14 @@ discard block |
||
477 | 477 | // Add the slug to the new array. |
478 | 478 | $template['category_slugs'][] = $category_slug; |
479 | 479 | |
480 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
481 | - self::$categories[ $category_slug ] = array( |
|
480 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
481 | + self::$categories[$category_slug] = array( |
|
482 | 482 | 'name' => $category, |
483 | 483 | 'count' => 0, |
484 | 484 | ); |
485 | 485 | } |
486 | 486 | |
487 | - self::$categories[ $category_slug ]['count']++; |
|
487 | + self::$categories[$category_slug]['count'] ++; |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() ); |
500 | 500 | foreach ( $redundant_cats as $redundant_cat ) { |
501 | 501 | $category_slug = sanitize_title( $redundant_cat ); |
502 | - unset( self::$categories[ $category_slug ] ); |
|
502 | + unset( self::$categories[$category_slug] ); |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | // Sort the categories by keys alphabetically. |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | 'count' => 0, |
525 | 525 | ); |
526 | 526 | } |
527 | - $special_categories['all-templates'] = array( |
|
527 | + $special_categories['all-templates'] = array( |
|
528 | 528 | 'name' => __( 'All Templates', 'formidable' ), |
529 | 529 | 'count' => self::get_template_count(), |
530 | 530 | ); |
@@ -552,9 +552,9 @@ discard block |
||
552 | 552 | */ |
553 | 553 | private static function assign_featured_templates() { |
554 | 554 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
555 | - if ( isset( self::$templates[ $key ] ) ) { |
|
556 | - self::$templates[ $key ]['is_featured'] = true; |
|
557 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
555 | + if ( isset( self::$templates[$key] ) ) { |
|
556 | + self::$templates[$key]['is_featured'] = true; |
|
557 | + self::$featured_templates[] = self::$templates[$key]; |
|
558 | 558 | } |
559 | 559 | } |
560 | 560 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | <?php esc_html_e( 'Content', 'formidable' ); ?> |
10 | 10 | </label> |
11 | 11 | <?php |
12 | - $e_args = array( |
|
12 | + $e_args = array( |
|
13 | 13 | 'textarea_name' => 'field_options[description_' . absint( $field['id'] ) . ']', |
14 | 14 | 'textarea_rows' => 8, |
15 | 15 | ); |
@@ -89,8 +89,8 @@ |
||
89 | 89 | public function __construct( $data ) { |
90 | 90 | $sections = array( 'counters', 'license', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
91 | 91 | foreach ( $sections as $section ) { |
92 | - if ( isset( $data[ $section ] ) ) { |
|
93 | - $this->view[ $section ] = $data[ $section ]; |
|
92 | + if ( isset( $data[$section] ) ) { |
|
93 | + $this->view[$section] = $data[$section]; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | |
149 | 149 | $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); |
150 | 150 | if ( $is_setup_intent ) { |
151 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
151 | + $errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
152 | 152 | } else { |
153 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
153 | + $errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
154 | 154 | } |
155 | 155 | |
156 | - if ( ! $errors[ 'field' . $cc_field_id ] ) { |
|
157 | - $errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.'; |
|
156 | + if ( ! $errors['field' . $cc_field_id] ) { |
|
157 | + $errors['field' . $cc_field_id] = 'Payment was not successfully processed.'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | global $frm_vars; |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | $save_draft = ! empty( $form->options['save_draft'] ); |
183 | 183 | |
184 | 184 | global $frm_vars; |
185 | - $frm_vars['created_entries'][ $form_id ]['errors'] = $errors; |
|
185 | + $frm_vars['created_entries'][$form_id]['errors'] = $errors; |
|
186 | 186 | |
187 | 187 | // Set to true to get FrmProFieldsHelper::get_page_with_error() run. |
188 | - $_POST[ 'frm_page_order_' . $form_id ] = true; |
|
188 | + $_POST['frm_page_order_' . $form_id] = true; |
|
189 | 189 | |
190 | 190 | if ( ! $save_draft ) { |
191 | 191 | // If draft saving is not on, delete the entry. |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | } |
195 | 195 | |
196 | 196 | // If draft saving is on, load the draft entry. |
197 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id; |
|
197 | + $frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id; |
|
198 | 198 | add_action( |
199 | 199 | 'frm_filter_final_form', |
200 | 200 | /** |
@@ -435,7 +435,7 @@ |
||
435 | 435 | * @return void |
436 | 436 | */ |
437 | 437 | public static function api_email_form( $form_key, $title = '', $description = '' ) { |
438 | - $user = wp_get_current_user(); |
|
438 | + $user = wp_get_current_user(); |
|
439 | 439 | $args = array( |
440 | 440 | 'api_url' => 'https://sandbox.formidableforms.com/api/wp-json/frm/v2/forms/' . $form_key . '?return=html&exclude_script=jquery&exclude_style=formidable-css', |
441 | 441 | 'title' => $title, |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | $field_val = ''; |
150 | 150 | if ( is_object( $this->field ) ) { |
151 | 151 | $field_val = $this->field->{$column}; |
152 | - } elseif ( is_array( $this->field ) && isset( $this->field[ $column ] ) ) { |
|
153 | - $field_val = $this->field[ $column ]; |
|
152 | + } elseif ( is_array( $this->field ) && isset( $this->field[$column] ) ) { |
|
153 | + $field_val = $this->field[$column]; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | return $field_val; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | if ( is_object( $this->field ) ) { |
165 | 165 | $this->field->{$column} = $value; |
166 | 166 | } elseif ( is_array( $this->field ) ) { |
167 | - $this->field[ $column ] = $value; |
|
167 | + $this->field[$column] = $value; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | printf( |
557 | 557 | /* translators: %s: Field type */ |
558 | 558 | esc_html__( '%s Options', 'formidable' ), |
559 | - esc_html( $all_field_types[ $args['display']['type'] ]['name'] ) |
|
559 | + esc_html( $all_field_types[$args['display']['type']]['name'] ) |
|
560 | 560 | ); |
561 | 561 | FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); |
562 | 562 | ?> |
@@ -664,8 +664,8 @@ discard block |
||
664 | 664 | |
665 | 665 | $fields = array_merge( $fields, $pro_fields ); |
666 | 666 | |
667 | - if ( isset( $fields[ $this->type ] ) ) { |
|
668 | - $name = is_array( $fields[ $this->type ] ) ? $fields[ $this->type ]['name'] : $fields[ $this->type ]; |
|
667 | + if ( isset( $fields[$this->type] ) ) { |
|
668 | + $name = is_array( $fields[$this->type] ) ? $fields[$this->type]['name'] : $fields[$this->type]; |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | return $name; |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | * @return array |
683 | 683 | */ |
684 | 684 | public function get_default_field_options() { |
685 | - $opts = array( |
|
685 | + $opts = array( |
|
686 | 686 | 'size' => '', |
687 | 687 | 'max' => '', |
688 | 688 | 'label' => '', |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | } |
1079 | 1079 | } else { |
1080 | 1080 | $args['save_array'] = $this->is_readonly_array(); |
1081 | - $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1081 | + $hidden .= $this->show_single_hidden( $selected_value, $args ); |
|
1082 | 1082 | } |
1083 | 1083 | |
1084 | 1084 | return $hidden; |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | protected function show_single_hidden( $selected, $args ) { |
1088 | 1088 | if ( $args['save_array'] ) { |
1089 | 1089 | $args['field_name'] .= '[]'; |
1090 | - $id = ''; |
|
1090 | + $id = ''; |
|
1091 | 1091 | } else { |
1092 | 1092 | $id = ' id="' . esc_attr( $args['html_id'] ) . '"'; |
1093 | 1093 | } |
@@ -1103,8 +1103,8 @@ discard block |
||
1103 | 1103 | $selected = $values['field_value']; |
1104 | 1104 | |
1105 | 1105 | if ( isset( $values['combo_name'] ) ) { |
1106 | - $options = $options[ $values['combo_name'] ]; |
|
1107 | - $selected = ( is_array( $selected ) && isset( $selected[ $values['combo_name'] ] ) ) ? $selected[ $values['combo_name'] ] : ''; |
|
1106 | + $options = $options[$values['combo_name']]; |
|
1107 | + $selected = ( is_array( $selected ) && isset( $selected[$values['combo_name']] ) ) ? $selected[$values['combo_name']] : ''; |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | 1110 | $input = $this->select_tag( $values ); |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | } |
1156 | 1156 | |
1157 | 1157 | protected function fill_display_field_values( $args = array() ) { |
1158 | - $defaults = array( |
|
1158 | + $defaults = array( |
|
1159 | 1159 | 'field_name' => 'item_meta[' . $this->get_field_column( 'id' ) . ']', |
1160 | 1160 | 'field_id' => $this->get_field_column( 'id' ), |
1161 | 1161 | 'field_plus_id' => '', |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | } |
1209 | 1209 | } |
1210 | 1210 | |
1211 | - if ( isset( $args['errors'][ 'field' . $args['field_id'] ] ) && ! $custom_error_fields ) { |
|
1211 | + if ( isset( $args['errors']['field' . $args['field_id']] ) && ! $custom_error_fields ) { |
|
1212 | 1212 | if ( $error_comes_first ) { |
1213 | 1213 | array_unshift( $describedby, 'frm_error_' . $args['html_id'] ); |
1214 | 1214 | } else { |
@@ -1287,11 +1287,11 @@ discard block |
||
1287 | 1287 | |
1288 | 1288 | $field_id = $this->get_field_column( 'id' ); |
1289 | 1289 | if ( ! array_key_exists( $field_id, $frm_validated_unique_values ) ) { |
1290 | - $frm_validated_unique_values[ $field_id ] = array(); |
|
1290 | + $frm_validated_unique_values[$field_id] = array(); |
|
1291 | 1291 | return false; |
1292 | 1292 | } |
1293 | 1293 | |
1294 | - $already_validated_this_value = in_array( $value, $frm_validated_unique_values[ $field_id ], true ); |
|
1294 | + $already_validated_this_value = in_array( $value, $frm_validated_unique_values[$field_id], true ); |
|
1295 | 1295 | return $already_validated_this_value; |
1296 | 1296 | } |
1297 | 1297 | |
@@ -1316,7 +1316,7 @@ discard block |
||
1316 | 1316 | private function value_validated_as_unique( $value ) { |
1317 | 1317 | global $frm_validated_unique_values; |
1318 | 1318 | $field_id = $this->get_field_column( 'id' ); |
1319 | - $frm_validated_unique_values[ $field_id ][] = $value; |
|
1319 | + $frm_validated_unique_values[$field_id][] = $value; |
|
1320 | 1320 | } |
1321 | 1321 | |
1322 | 1322 | public function get_value_to_save( $value, $atts ) { |
@@ -1353,8 +1353,8 @@ discard block |
||
1353 | 1353 | $value = $this->prepare_display_value( $value, $atts ); |
1354 | 1354 | |
1355 | 1355 | if ( is_array( $value ) ) { |
1356 | - if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[ $atts['show'] ] ) ) { |
|
1357 | - $value = $value[ $atts['show'] ]; |
|
1356 | + if ( isset( $atts['show'] ) && $atts['show'] && isset( $value[$atts['show']] ) ) { |
|
1357 | + $value = $value[$atts['show']]; |
|
1358 | 1358 | } elseif ( ! isset( $atts['return_array'] ) || ! $atts['return_array'] ) { |
1359 | 1359 | $sep = isset( $atts['sep'] ) ? $atts['sep'] : ', '; |
1360 | 1360 | $value = implode( $sep, $value ); |
@@ -1484,8 +1484,8 @@ discard block |
||
1484 | 1484 | $saved_entries = $atts['ids']; |
1485 | 1485 | $new_value = array(); |
1486 | 1486 | foreach ( (array) $value as $old_child_id ) { |
1487 | - if ( isset( $saved_entries[ $old_child_id ] ) ) { |
|
1488 | - $new_value[] = $saved_entries[ $old_child_id ]; |
|
1487 | + if ( isset( $saved_entries[$old_child_id] ) ) { |
|
1488 | + $new_value[] = $saved_entries[$old_child_id]; |
|
1489 | 1489 | } |
1490 | 1490 | } |
1491 | 1491 |
@@ -40,8 +40,8 @@ |
||
40 | 40 | */ |
41 | 41 | public function get_video( $type = 'welcome' ) { |
42 | 42 | $videos = $this->get_api_info(); |
43 | - if ( isset( $videos[ $type ] ) ) { |
|
44 | - return $videos[ $type ]; |
|
43 | + if ( isset( $videos[$type] ) ) { |
|
44 | + return $videos[$type]; |
|
45 | 45 | } |
46 | 46 | return array(); |
47 | 47 | } |
@@ -113,8 +113,8 @@ |
||
113 | 113 | $label = ( 'category' === $term->taxonomy || 'tag' === $term->taxonomy ) ? $term->taxonomy : 'term'; |
114 | 114 | ?> |
115 | 115 | <term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php |
116 | - if ( ! empty( $parent_slugs[ $term->parent ] ) ) { |
|
117 | - echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>'; |
|
116 | + if ( ! empty( $parent_slugs[$term->parent] ) ) { |
|
117 | + echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>'; |
|
118 | 118 | } |
119 | 119 | if ( ! empty( $term->name ) ) { |
120 | 120 | echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |