@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $form_ids = $this->get_form_ids( $form_id ); |
135 | 135 | $s_query['it.form_id'] = count( $form_ids ) > 1 ? $form_ids : $form_ids[0]; |
136 | 136 | } else { |
137 | - $s_query[] = array( |
|
137 | + $s_query[] = array( |
|
138 | 138 | 'or' => 1, |
139 | 139 | 'parent_form_id' => null, |
140 | 140 | 'parent_form_id <' => 1, |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | $r = "<tr id='item-action-{$item->id}'$style>"; |
285 | 285 | |
286 | - list( $columns, $hidden, , $primary ) = $this->get_column_info(); |
|
286 | + list( $columns, $hidden,, $primary ) = $this->get_column_info(); |
|
287 | 287 | $action_col = false; |
288 | 288 | $action_columns = $this->get_action_columns(); |
289 | 289 |
@@ -100,7 +100,7 @@ |
||
100 | 100 | 'secondary-button-role' => 'button', |
101 | 101 | 'secondary-button-skip-step' => true, |
102 | 102 | ); |
103 | - $args = wp_parse_args( $args, $defaults ); |
|
103 | + $args = wp_parse_args( $args, $defaults ); |
|
104 | 104 | |
105 | 105 | // Set the primary button attributes. |
106 | 106 | $primary_button_attributes = array( |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | * @return array |
182 | 182 | */ |
183 | 183 | private function prepare_array_property( $index, $atts ) { |
184 | - if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) { |
|
184 | + if ( isset( $atts[$index] ) && ! empty( $atts[$index] ) ) { |
|
185 | 185 | |
186 | - if ( is_array( $atts[ $index ] ) ) { |
|
187 | - $property = $atts[ $index ]; |
|
186 | + if ( is_array( $atts[$index] ) ) { |
|
187 | + $property = $atts[$index]; |
|
188 | 188 | } else { |
189 | - $property = explode( ',', $atts[ $index ] ); |
|
189 | + $property = explode( ',', $atts[$index] ); |
|
190 | 190 | } |
191 | 191 | } else { |
192 | 192 | $property = array(); |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | ); |
267 | 267 | } |
268 | 268 | |
269 | - $ip = array( |
|
269 | + $ip = array( |
|
270 | 270 | 'label' => __( 'IP Address', 'formidable' ), |
271 | 271 | 'value' => $this->entry->ip, |
272 | 272 | ); |
273 | - $browser = array( |
|
273 | + $browser = array( |
|
274 | 274 | 'label' => __( 'User-Agent (Browser/OS)', 'formidable' ), |
275 | 275 | 'value' => isset( $entry_description['browser'] ) ? FrmEntriesHelper::get_browser( $entry_description['browser'] ) : '', |
276 | 276 | ); |
@@ -357,6 +357,6 @@ discard block |
||
357 | 357 | * @return void |
358 | 358 | */ |
359 | 359 | protected function add_field_values( $field ) { |
360 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
360 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
361 | 361 | } |
362 | 362 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | global $wpdb; |
60 | 60 | |
61 | - $values = array( |
|
61 | + $values = array( |
|
62 | 62 | 'item_id' => $entry_id, |
63 | 63 | 'field_id' => $field_id, |
64 | 64 | ); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) == '' ) ) { |
134 | 134 | // remove blank fields |
135 | - unset( $values[ $field_id ] ); |
|
135 | + unset( $values[$field_id] ); |
|
136 | 136 | } else { |
137 | 137 | // if value exists, then update it |
138 | 138 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public static function get_meta_value( $entry, $field_id ) { |
212 | 212 | if ( isset( $entry->metas ) ) { |
213 | - return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false; |
|
213 | + return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false; |
|
214 | 214 | } else { |
215 | 215 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
216 | 216 | } |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
229 | 229 | } |
230 | 230 | |
231 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
232 | - $result = $cached->metas[ $field_id ]; |
|
231 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
232 | + $result = $cached->metas[$field_id]; |
|
233 | 233 | |
234 | 234 | return wp_unslash( $result ); |
235 | 235 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | 'stripslashes' => true, |
258 | 258 | 'is_draft' => false, |
259 | 259 | ); |
260 | - $args = wp_parse_args( $args, $defaults ); |
|
260 | + $args = wp_parse_args( $args, $defaults ); |
|
261 | 261 | |
262 | 262 | $query = array(); |
263 | 263 | self::meta_field_query( $field_id, $order, $limit, $args, $query ); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | foreach ( $values as $k => $v ) { |
274 | 274 | FrmAppHelper::unserialize_or_decode( $v ); |
275 | - $values[ $k ] = $v; |
|
275 | + $values[$k] = $v; |
|
276 | 276 | unset( $k, $v ); |
277 | 277 | } |
278 | 278 | |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | |
340 | 340 | foreach ( $results as $k => $result ) { |
341 | 341 | FrmAppHelper::unserialize_or_decode( $result->meta_value ); |
342 | - $results[ $k ]->meta_value = wp_unslash( $result->meta_value ); |
|
342 | + $results[$k]->meta_value = wp_unslash( $result->meta_value ); |
|
343 | 343 | unset( $k, $result ); |
344 | 344 | } |
345 | 345 | |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | 'user_id' => '', |
353 | 353 | 'group_by' => '', |
354 | 354 | ); |
355 | - $args = wp_parse_args( $args, $defaults ); |
|
355 | + $args = wp_parse_args( $args, $defaults ); |
|
356 | 356 | |
357 | 357 | $query = array(); |
358 | 358 | self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query ); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } elseif ( false !== strpos( $args['is_draft'], ',' ) ) { |
420 | 420 | $is_draft = array_reduce( |
421 | 421 | explode( ',', $args['is_draft'] ), |
422 | - function ( $total, $current ) { |
|
422 | + function( $total, $current ) { |
|
423 | 423 | if ( is_numeric( $current ) ) { |
424 | 424 | $total[] = absint( $current ); |
425 | 425 | } |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | $groups = FrmFormActionsController::form_action_groups(); |
209 | 209 | $group = 'misc'; |
210 | 210 | |
211 | - if ( isset( $action_options['group'] ) && isset( $groups[ $action_options['group'] ] ) ) { |
|
211 | + if ( isset( $action_options['group'] ) && isset( $groups[$action_options['group']] ) ) { |
|
212 | 212 | $group = $action_options['group']; |
213 | - } elseif ( isset( $groups[ $this->id_base ] ) ) { |
|
213 | + } elseif ( isset( $groups[$this->id_base] ) ) { |
|
214 | 214 | $group = $this->id_base; |
215 | 215 | } else { |
216 | 216 | foreach ( $groups as $name => $check_group ) { |
@@ -221,8 +221,8 @@ discard block |
||
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | - $groups[ $group ]['id'] = $group; |
|
225 | - return $groups[ $group ]; |
|
224 | + $groups[$group]['id'] = $group; |
|
225 | + return $groups[$group]; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | * @return integer $post_id |
334 | 334 | */ |
335 | 335 | public function maybe_create_action( $action, $forms ) { |
336 | - if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[ $action['menu_order'] ] ) && $forms[ $action['menu_order'] ] == 'updated' ) { |
|
336 | + if ( isset( $action['ID'] ) && is_numeric( $action['ID'] ) && isset( $forms[$action['menu_order']] ) && $forms[$action['menu_order']] == 'updated' ) { |
|
337 | 337 | // Update action only |
338 | 338 | $action['post_content'] = FrmAppHelper::maybe_json_decode( $action['post_content'] ); |
339 | 339 | $post_id = $this->save_settings( $action ); |
@@ -356,18 +356,18 @@ discard block |
||
356 | 356 | $switch = $this->get_global_switch_fields(); |
357 | 357 | |
358 | 358 | foreach ( (array) $action->post_content as $key => $val ) { |
359 | - if ( is_numeric( $val ) && isset( $frm_duplicate_ids[ $val ] ) ) { |
|
360 | - $action->post_content[ $key ] = $frm_duplicate_ids[ $val ]; |
|
359 | + if ( is_numeric( $val ) && isset( $frm_duplicate_ids[$val] ) ) { |
|
360 | + $action->post_content[$key] = $frm_duplicate_ids[$val]; |
|
361 | 361 | } elseif ( ! is_array( $val ) ) { |
362 | - $action->post_content[ $key ] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | - } elseif ( isset( $switch[ $key ] ) && is_array( $switch[ $key ] ) ) { |
|
362 | + $action->post_content[$key] = FrmFieldsHelper::switch_field_ids( $val ); |
|
363 | + } elseif ( isset( $switch[$key] ) && is_array( $switch[$key] ) ) { |
|
364 | 364 | // loop through each value if empty |
365 | - if ( empty( $switch[ $key ] ) ) { |
|
366 | - $switch[ $key ] = array_keys( $val ); |
|
365 | + if ( empty( $switch[$key] ) ) { |
|
366 | + $switch[$key] = array_keys( $val ); |
|
367 | 367 | } |
368 | 368 | |
369 | - foreach ( $switch[ $key ] as $subkey ) { |
|
370 | - $action->post_content[ $key ] = $this->duplicate_array_walk( $action->post_content[ $key ], $subkey, $val ); |
|
369 | + foreach ( $switch[$key] as $subkey ) { |
|
370 | + $action->post_content[$key] = $this->duplicate_array_walk( $action->post_content[$key], $subkey, $val ); |
|
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
@@ -385,20 +385,20 @@ discard block |
||
385 | 385 | foreach ( $subkey as $subkey2 ) { |
386 | 386 | foreach ( (array) $val as $ck => $cv ) { |
387 | 387 | if ( is_array( $cv ) ) { |
388 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey2, $cv ); |
|
389 | - } elseif ( isset( $cv[ $subkey ] ) && is_numeric( $cv[ $subkey ] ) && isset( $frm_duplicate_ids[ $cv[ $subkey ] ] ) ) { |
|
390 | - $action[ $ck ][ $subkey ] = $frm_duplicate_ids[ $cv[ $subkey ] ]; |
|
388 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey2, $cv ); |
|
389 | + } elseif ( isset( $cv[$subkey] ) && is_numeric( $cv[$subkey] ) && isset( $frm_duplicate_ids[$cv[$subkey]] ) ) { |
|
390 | + $action[$ck][$subkey] = $frm_duplicate_ids[$cv[$subkey]]; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | } |
394 | 394 | } else { |
395 | 395 | foreach ( (array) $val as $ck => $cv ) { |
396 | 396 | if ( is_array( $cv ) ) { |
397 | - $action[ $ck ] = $this->duplicate_array_walk( $action[ $ck ], $subkey, $cv ); |
|
398 | - } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[ $cv ] ) ) { |
|
399 | - $action[ $ck ] = $frm_duplicate_ids[ $cv ]; |
|
397 | + $action[$ck] = $this->duplicate_array_walk( $action[$ck], $subkey, $cv ); |
|
398 | + } elseif ( $ck == $subkey && isset( $frm_duplicate_ids[$cv] ) ) { |
|
399 | + $action[$ck] = $frm_duplicate_ids[$cv]; |
|
400 | 400 | } elseif ( $ck == $subkey ) { |
401 | - $action[ $ck ] = $this->maybe_switch_field_ids( $action[ $ck ] ); |
|
401 | + $action[$ck] = $this->maybe_switch_field_ids( $action[$ck] ); |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 | }//end if |
@@ -422,10 +422,10 @@ discard block |
||
422 | 422 | } |
423 | 423 | |
424 | 424 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
425 | - if ( isset( $_POST[ $this->option_name ] ) && is_array( $_POST[ $this->option_name ] ) ) { |
|
425 | + if ( isset( $_POST[$this->option_name] ) && is_array( $_POST[$this->option_name] ) ) { |
|
426 | 426 | // Sanitizing removes scripts and <email> type of values. |
427 | 427 | // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized, WordPress.Security.NonceVerification.Missing |
428 | - $settings = wp_unslash( $_POST[ $this->option_name ] ); |
|
428 | + $settings = wp_unslash( $_POST[$this->option_name] ); |
|
429 | 429 | } else { |
430 | 430 | return; |
431 | 431 | } |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | foreach ( $settings as $number => $new_instance ) { |
436 | 436 | $this->_set( $number ); |
437 | 437 | |
438 | - $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); |
|
438 | + $old_instance = isset( $all_instances[$number] ) ? $all_instances[$number] : array(); |
|
439 | 439 | |
440 | 440 | if ( ! isset( $new_instance['post_status'] ) ) { |
441 | 441 | $new_instance['post_status'] = 'draft'; |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | $instance['post_content'] = apply_filters( 'frm_before_save_' . $this->id_base . '_action', $instance['post_content'], $instance, $new_instance, $old_instance, $this ); |
474 | 474 | |
475 | 475 | if ( false !== $instance ) { |
476 | - $all_instances[ $number ] = $instance; |
|
476 | + $all_instances[$number] = $instance; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | $action_ids[] = $this->save_settings( $instance ); |
@@ -555,12 +555,12 @@ discard block |
||
555 | 555 | // some plugins/themes are formatting the post_excerpt |
556 | 556 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
557 | 557 | |
558 | - if ( ! isset( $action_controls[ $action->post_excerpt ] ) ) { |
|
558 | + if ( ! isset( $action_controls[$action->post_excerpt] ) ) { |
|
559 | 559 | continue; |
560 | 560 | } |
561 | 561 | |
562 | - $action = $action_controls[ $action->post_excerpt ]->prepare_action( $action ); |
|
563 | - $settings[ $action->ID ] = $action; |
|
562 | + $action = $action_controls[$action->post_excerpt]->prepare_action( $action ); |
|
563 | + $settings[$action->ID] = $action; |
|
564 | 564 | |
565 | 565 | if ( count( $settings ) >= $limit ) { |
566 | 566 | break; |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | 'limit' => 99, |
594 | 594 | 'post_status' => $default_status, |
595 | 595 | ); |
596 | - $args = wp_parse_args( $args, $defaults ); |
|
596 | + $args = wp_parse_args( $args, $defaults ); |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | /** |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | |
660 | 660 | $action = $this->prepare_action( $action ); |
661 | 661 | |
662 | - $settings[ $action->ID ] = $action; |
|
662 | + $settings[$action->ID] = $action; |
|
663 | 663 | } |
664 | 664 | |
665 | 665 | if ( 1 === $limit ) { |
@@ -702,10 +702,10 @@ discard block |
||
702 | 702 | |
703 | 703 | foreach ( $default_values as $k => $vals ) { |
704 | 704 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
705 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { |
|
705 | + if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[$k] ) ) { |
|
706 | 706 | continue; |
707 | 707 | } |
708 | - $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
|
708 | + $action->post_content[$k] = wp_parse_args( $action->post_content[$k], $vals ); |
|
709 | 709 | } |
710 | 710 | } |
711 | 711 | |
@@ -793,9 +793,9 @@ discard block |
||
793 | 793 | |
794 | 794 | // fill with existing options |
795 | 795 | foreach ( $action->post_content as $name => $val ) { |
796 | - if ( isset( $form->options[ $name ] ) ) { |
|
797 | - $action->post_content[ $name ] = $form->options[ $name ]; |
|
798 | - unset( $form->options[ $name ] ); |
|
796 | + if ( isset( $form->options[$name] ) ) { |
|
797 | + $action->post_content[$name] = $form->options[$name]; |
|
798 | + unset( $form->options[$name] ); |
|
799 | 799 | } |
800 | 800 | } |
801 | 801 | |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | $stop = $stop ? false : true; |
862 | 862 | } |
863 | 863 | |
864 | - $met[ $stop ] = $stop; |
|
864 | + $met[$stop] = $stop; |
|
865 | 865 | }//end foreach |
866 | 866 | |
867 | 867 | if ( $notification['conditions']['any_all'] == 'all' && ! empty( $met ) && isset( $met[0] ) && isset( $met[1] ) ) { |
@@ -915,8 +915,8 @@ discard block |
||
915 | 915 | private static function get_value_from_entry( $entry, $field_id ) { |
916 | 916 | $observed_value = ''; |
917 | 917 | |
918 | - if ( isset( $entry->metas[ $field_id ] ) ) { |
|
919 | - $observed_value = $entry->metas[ $field_id ]; |
|
918 | + if ( isset( $entry->metas[$field_id] ) ) { |
|
919 | + $observed_value = $entry->metas[$field_id]; |
|
920 | 920 | } elseif ( $entry->post_id && FrmAppHelper::pro_is_installed() ) { |
921 | 921 | $field = FrmField::getOne( $field_id ); |
922 | 922 | $observed_value = FrmProEntryMetaHelper::get_post_or_meta_value( |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | ); |
315 | 315 | |
316 | 316 | $where_is = strtolower( $where_is ); |
317 | - if ( isset( $switch_to[ $where_is ] ) ) { |
|
318 | - return ' ' . $switch_to[ $where_is ]; |
|
317 | + if ( isset( $switch_to[$where_is] ) ) { |
|
318 | + return ' ' . $switch_to[$where_is]; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | // > and < need a little more work since we don't want them switched to >= and <= |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | $temp_args = $args; |
381 | 381 | foreach ( $temp_args as $k => $v ) { |
382 | 382 | if ( $v == '' ) { |
383 | - unset( $args[ $k ] ); |
|
383 | + unset( $args[$k] ); |
|
384 | 384 | continue; |
385 | 385 | } |
386 | 386 | |
387 | 387 | $db_name = strtoupper( str_replace( '_', ' ', $k ) ); |
388 | 388 | if ( strpos( $v, $db_name ) === false ) { |
389 | - $args[ $k ] = $db_name . ' ' . $v; |
|
389 | + $args[$k] = $db_name . ' ' . $v; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | |
@@ -460,13 +460,13 @@ discard block |
||
460 | 460 | private static function esc_query_args( &$args ) { |
461 | 461 | foreach ( $args as $param => $value ) { |
462 | 462 | if ( $param == 'order_by' ) { |
463 | - $args[ $param ] = self::esc_order( $value ); |
|
463 | + $args[$param] = self::esc_order( $value ); |
|
464 | 464 | } elseif ( $param == 'limit' ) { |
465 | - $args[ $param ] = self::esc_limit( $value ); |
|
465 | + $args[$param] = self::esc_limit( $value ); |
|
466 | 466 | } |
467 | 467 | |
468 | - if ( $args[ $param ] == '' ) { |
|
469 | - unset( $args[ $param ] ); |
|
468 | + if ( $args[$param] == '' ) { |
|
469 | + unset( $args[$param] ); |
|
470 | 470 | } |
471 | 471 | } |
472 | 472 | } |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $limit = explode( ',', trim( $limit ) ); |
550 | 550 | foreach ( $limit as $k => $l ) { |
551 | 551 | if ( is_numeric( $l ) ) { |
552 | - $limit[ $k ] = $l; |
|
552 | + $limit[$k] = $l; |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 | |
@@ -702,7 +702,7 @@ discard block |
||
702 | 702 | */ |
703 | 703 | public static function add_key_to_group_cache( $key, $group ) { |
704 | 704 | $cached = self::get_group_cached_keys( $group ); |
705 | - $cached[ $key ] = $key; |
|
705 | + $cached[$key] = $key; |
|
706 | 706 | wp_cache_set( 'cached_keys', $cached, $group, 300 ); |
707 | 707 | } |
708 | 708 |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // Build total for each currency. |
151 | 151 | foreach ( $payment_data['total'] as $currency => $amount ) { |
152 | - $stats[ 'payments_total_' . $currency ] = array( |
|
152 | + $stats['payments_total_' . $currency] = array( |
|
153 | 153 | // translators: currency name. |
154 | 154 | 'label' => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ), |
155 | 155 | 'count' => $amount, |
@@ -171,23 +171,23 @@ discard block |
||
171 | 171 | |
172 | 172 | // Compare total for each currency. |
173 | 173 | foreach ( $payment_data['total'] as $currency => $amount ) { |
174 | - if ( ! isset( $prev_payment_data['total'][ $currency ] ) ) { |
|
175 | - $stats[ 'payments_total_' . $currency ]['compare'] = 1; |
|
174 | + if ( ! isset( $prev_payment_data['total'][$currency] ) ) { |
|
175 | + $stats['payments_total_' . $currency]['compare'] = 1; |
|
176 | 176 | continue; |
177 | 177 | } |
178 | 178 | |
179 | - $stats[ 'payments_total_' . $currency ]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][ $currency ] ); |
|
180 | - unset( $prev_payment_data['total'][ $currency ] ); |
|
179 | + $stats['payments_total_' . $currency]['compare'] = $this->get_compare_diff( $amount, $prev_payment_data['total'][$currency] ); |
|
180 | + unset( $prev_payment_data['total'][$currency] ); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // If prev month has more currencies. |
184 | 184 | foreach ( $prev_payment_data['total'] as $currency => $amount ) { |
185 | - $stats[ 'payments_total_' . $currency ] = array( |
|
185 | + $stats['payments_total_' . $currency] = array( |
|
186 | 186 | // translators: currency name. |
187 | 187 | 'label' => sprintf( __( 'Total %s', 'formidable' ), strtoupper( $currency ) ), |
188 | 188 | 'count' => 0, |
189 | 189 | 'display' => $this->get_formatted_price( 0, $currency ), |
190 | - 'compare' => -1, |
|
190 | + 'compare' => - 1, |
|
191 | 191 | ); |
192 | 192 | } |
193 | 193 | }//end if |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param array $atts |
45 | 45 | */ |
46 | 46 | private function _set( $param, $atts ) { |
47 | - if ( isset( $atts[ $param ] ) ) { |
|
48 | - $this->{$param} = $atts[ $param ]; |
|
47 | + if ( isset( $atts[$param] ) ) { |
|
48 | + $this->{$param} = $atts[$param]; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | |
90 | 90 | $exclude = array( 'field_obj', 'html' ); |
91 | 91 | foreach ( $exclude as $ex ) { |
92 | - if ( isset( $atts[ $ex ] ) ) { |
|
93 | - unset( $this->pass_args[ $ex ] ); |
|
92 | + if ( isset( $atts[$ex] ) ) { |
|
93 | + unset( $this->pass_args[$ex] ); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | } |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | * @param array $set |
103 | 103 | */ |
104 | 104 | private function set_from_field( $atts, $set ) { |
105 | - if ( isset( $atts[ $set['param'] ] ) ) { |
|
106 | - $this->{$set['param']} = $atts[ $set['param'] ]; |
|
105 | + if ( isset( $atts[$set['param']] ) ) { |
|
106 | + $this->{$set['param']} = $atts[$set['param']]; |
|
107 | 107 | } else { |
108 | 108 | $this->{$set['param']} = $this->field_obj->get_field_column( $set['default'] ); |
109 | 109 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | */ |
231 | 231 | private function replace_error_shortcode() { |
232 | 232 | $this->maybe_add_error_id(); |
233 | - $error = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? $this->pass_args['errors'][ 'field' . $this->field_id ] : false; |
|
233 | + $error = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? $this->pass_args['errors']['field' . $this->field_id] : false; |
|
234 | 234 | |
235 | 235 | if ( ! empty( $error ) && false === strpos( $this->html, 'role="alert"' ) && FrmAppHelper::should_include_alert_role_on_field_errors() ) { |
236 | 236 | $error_body = self::get_error_body( $this->html ); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | * @since 3.06.02 |
272 | 272 | */ |
273 | 273 | private function maybe_add_error_id() { |
274 | - if ( ! isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ) { |
|
274 | + if ( ! isset( $this->pass_args['errors']['field' . $this->field_id] ) ) { |
|
275 | 275 | return; |
276 | 276 | } |
277 | 277 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | preg_match_all( "/\[(input|deletelink)\b(.*?)(?:(\/))?\]/s", $this->html, $shortcodes, PREG_PATTERN_ORDER ); |
352 | 352 | |
353 | 353 | foreach ( $shortcodes[0] as $short_key => $tag ) { |
354 | - $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][ $short_key ] ); |
|
354 | + $shortcode_atts = FrmShortcodeHelper::get_shortcode_attribute_array( $shortcodes[2][$short_key] ); |
|
355 | 355 | $tag = FrmShortcodeHelper::get_shortcode_tag( $shortcodes, $short_key ); |
356 | 356 | |
357 | 357 | $replace_with = ''; |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | $replace_with = $this->replace_input_shortcode( $shortcode_atts ); |
363 | 363 | } |
364 | 364 | |
365 | - $this->html = str_replace( $shortcodes[0][ $short_key ], $replace_with, $this->html ); |
|
365 | + $this->html = str_replace( $shortcodes[0][$short_key], $replace_with, $this->html ); |
|
366 | 366 | } |
367 | 367 | } |
368 | 368 | |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | */ |
385 | 385 | private function prepare_input_shortcode_atts( $shortcode_atts ) { |
386 | 386 | if ( isset( $shortcode_atts['opt'] ) ) { |
387 | - --$shortcode_atts['opt']; |
|
387 | + -- $shortcode_atts['opt']; |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | $field_class = isset( $shortcode_atts['class'] ) ? $shortcode_atts['class'] : ''; |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | unset( $shortcode_atts['class'] ); |
395 | 395 | } |
396 | 396 | |
397 | - $shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? 'true' : 'false'; |
|
397 | + $shortcode_atts['aria-invalid'] = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? 'true' : 'false'; |
|
398 | 398 | |
399 | 399 | $this->field_obj->set_field_column( 'shortcodes', $shortcode_atts ); |
400 | 400 | |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | */ |
447 | 447 | private function get_field_div_classes() { |
448 | 448 | // Add error class |
449 | - $classes = isset( $this->pass_args['errors'][ 'field' . $this->field_id ] ) ? ' frm_blank_field' : ''; |
|
449 | + $classes = isset( $this->pass_args['errors']['field' . $this->field_id] ) ? ' frm_blank_field' : ''; |
|
450 | 450 | |
451 | 451 | // Add label position class |
452 | 452 | $settings = $this->field_obj->display_field_settings(); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | foreach ( $pass_settings as $setting ) { |
146 | 146 | if ( isset( $settings_list->$setting ) ) { |
147 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
147 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | $message_settings = array(); |
180 | 180 | foreach ( $messages as $message ) { |
181 | - $message_settings[ $message ] = $settings_list->$message; |
|
181 | + $message_settings[$message] = $settings_list->$message; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | return $message_settings; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
200 | 200 | if ( isset( $settings_list->$frm_role ) ) { |
201 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
201 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | ); |
269 | 269 | |
270 | 270 | foreach ( $settings as $setting ) { |
271 | - if ( isset( $form->options[ $setting ] ) ) { |
|
272 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
271 | + if ( isset( $form->options[$setting] ) ) { |
|
272 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
273 | 273 | } |
274 | 274 | } |
275 | 275 | |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args ); |
329 | 329 | foreach ( $fields as $k => $field ) { |
330 | 330 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
331 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
331 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
332 | 332 | } |
333 | 333 | return $fields; |
334 | 334 | } |