@@ -28,8 +28,11 @@ |
||
| 28 | 28 | <div class="<?php echo esc_attr( $classes ); ?>"> |
| 29 | 29 | <?php if ( $is_active ) : ?> |
| 30 | 30 | <?php echo esc_html( $details['label'] ); ?> |
| 31 | - <?php else : ?> |
|
| 32 | - <a href="<?php echo esc_url( $details['url'] ); ?>"> |
|
| 31 | + <?php else { |
|
| 32 | + : ?> |
|
| 33 | + <a href="<?php echo esc_url( $details['url'] ); |
|
| 34 | +} |
|
| 35 | +?>"> |
|
| 33 | 36 | <?php echo esc_html( $details['label'] ); ?> |
| 34 | 37 | </a> |
| 35 | 38 | <?php endif; ?> |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | 'payments' => $frm_payment->get_count(), |
| 129 | 129 | 'subscriptions' => $frm_sub->get_count(), |
| 130 | 130 | ); |
| 131 | - $type = FrmAppHelper::get_simple_request( |
|
| 131 | + $type = FrmAppHelper::get_simple_request( |
|
| 132 | 132 | array( |
| 133 | 133 | 'param' => 'trans_type', |
| 134 | 134 | 'type' => 'request', |
@@ -139,10 +139,10 @@ discard block |
||
| 139 | 139 | foreach ( $statuses as $status => $name ) { |
| 140 | 140 | $class = $status === $type ? ' class="current"' : ''; |
| 141 | 141 | |
| 142 | - if ( $counts[ $status ] || 'published' === $status ) { |
|
| 143 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 142 | + if ( $counts[$status] || 'published' === $status ) { |
|
| 143 | + $links[$status] = '<a href="' . esc_url( '?page=formidable-payments&trans_type=' . $status ) . '" ' . $class . '>' |
|
| 144 | 144 | // translators: %1$s: Transaction type (Payments or Subscriptions), %2$s: Span start tag, %3$s: Count, %4$s: Span close tag. |
| 145 | - . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[ $status ] ), '</span>' ) |
|
| 145 | + . sprintf( esc_html__( '%1$s %2$s(%3$s)%4$s', 'formidable' ), esc_html( $name ), '<span class="count">', number_format_i18n( $counts[$status] ), '</span>' ) |
|
| 146 | 146 | . '</a>'; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | echo '<tr id="payment-' . esc_attr( $item->id ) . '" '; |
| 238 | 238 | |
| 239 | 239 | $is_alternate = 0 === $alt % 2; |
| 240 | - ++$alt; |
|
| 240 | + ++ $alt; |
|
| 241 | 241 | |
| 242 | 242 | if ( $is_alternate ) { |
| 243 | 243 | echo 'class="alternate"'; |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $form_ids = array(); |
| 348 | 348 | |
| 349 | 349 | foreach ( $forms as $form ) { |
| 350 | - $form_ids[ $form->id ] = $form; |
|
| 350 | + $form_ids[$form->id] = $form; |
|
| 351 | 351 | unset( $form ); |
| 352 | 352 | } |
| 353 | 353 | |
@@ -500,8 +500,8 @@ discard block |
||
| 500 | 500 | * @return mixed |
| 501 | 501 | */ |
| 502 | 502 | private function get_form_id_column( $item, $atts ) { |
| 503 | - if ( isset( $atts['form_ids'][ $item->item_id ] ) ) { |
|
| 504 | - return FrmFormsHelper::edit_form_link( $atts['form_ids'][ $item->item_id ]->form_id ); |
|
| 503 | + if ( isset( $atts['form_ids'][$item->item_id] ) ) { |
|
| 504 | + return FrmFormsHelper::edit_form_link( $atts['form_ids'][$item->item_id]->form_id ); |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | return ''; |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | */ |
| 584 | 584 | private function get_processing_tooltip() { |
| 585 | 585 | return FrmAppHelper::clip( |
| 586 | - function () { |
|
| 586 | + function() { |
|
| 587 | 587 | FrmAppHelper::tooltip_icon( __( 'This payment method may take between 4-5 business days to process.', 'formidable' ) ); |
| 588 | 588 | } |
| 589 | 589 | ); |
@@ -363,11 +363,11 @@ discard block |
||
| 363 | 363 | 'coupon' => '2026-01-13', |
| 364 | 364 | ); |
| 365 | 365 | |
| 366 | - if ( ! isset( $release_dates[ $type ] ) ) { |
|
| 366 | + if ( ! isset( $release_dates[$type] ) ) { |
|
| 367 | 367 | return false; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - $release_date = $release_dates[ $type ]; |
|
| 370 | + $release_date = $release_dates[$type]; |
|
| 371 | 371 | |
| 372 | 372 | $three_months_after_release = gmdate( 'Y-m-d', strtotime( $release_date . ' + 90 days' ) ); |
| 373 | 373 | return gmdate( 'Y-m-d' ) < $three_months_after_release; |
@@ -401,8 +401,8 @@ discard block |
||
| 401 | 401 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
| 402 | 402 | |
| 403 | 403 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
| 404 | - if ( isset( $values[ $col ] ) ) { |
|
| 405 | - $new_values[ $col ] = $values[ $col ]; |
|
| 404 | + if ( isset( $values[$col] ) ) { |
|
| 405 | + $new_values[$col] = $values[$col]; |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
| 415 | 415 | |
| 416 | 416 | if ( isset( $values['id'] ) ) { |
| 417 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
| 417 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
| 418 | 418 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
| 419 | 419 | } |
| 420 | 420 | |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | foreach ( $new_values as $k => $v ) { |
| 424 | 424 | if ( is_array( $v ) ) { |
| 425 | - $new_values[ $k ] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v ); |
|
| 425 | + $new_values[$k] = $k === 'default_value' ? FrmAppHelper::maybe_json_encode( $v ) : serialize( $v ); |
|
| 426 | 426 | } |
| 427 | 427 | unset( $k, $v ); |
| 428 | 428 | } |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | } |
| 442 | 442 | |
| 443 | 443 | if ( isset( $values['id'] ) ) { |
| 444 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
| 444 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | return $new_id; |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | * |
| 496 | 496 | * @return string |
| 497 | 497 | */ |
| 498 | - function ( $match ) { |
|
| 498 | + function( $match ) { |
|
| 499 | 499 | $attr = shortcode_parse_atts( $match[3] ); |
| 500 | 500 | |
| 501 | 501 | if ( ! is_array( $attr ) ) { |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
| 526 | - $safe_atts[ $key ] = $value; |
|
| 526 | + $safe_atts[$key] = $value; |
|
| 527 | 527 | } |
| 528 | 528 | }//end foreach |
| 529 | 529 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
| 596 | 596 | global $frm_duplicate_ids; |
| 597 | 597 | |
| 598 | - $where = array( |
|
| 598 | + $where = array( |
|
| 599 | 599 | array( |
| 600 | 600 | 'or' => 1, |
| 601 | 601 | 'fi.form_id' => $old_form_id, |
@@ -642,8 +642,8 @@ discard block |
||
| 642 | 642 | |
| 643 | 643 | $values = apply_filters( 'frm_duplicated_field', $values ); |
| 644 | 644 | $new_id = self::create( $values ); |
| 645 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
| 646 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
| 645 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
| 646 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
| 647 | 647 | unset( $field ); |
| 648 | 648 | }//end foreach |
| 649 | 649 | } |
@@ -693,11 +693,11 @@ discard block |
||
| 693 | 693 | |
| 694 | 694 | // serialize array values |
| 695 | 695 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
| 696 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
| 696 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
| 697 | 697 | if ( 'field_options' === $opt ) { |
| 698 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
| 698 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
| 699 | 699 | } |
| 700 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
| 700 | + $values[$opt] = serialize( $values[$opt] ); |
|
| 701 | 701 | } |
| 702 | 702 | } |
| 703 | 703 | |
@@ -910,8 +910,8 @@ discard block |
||
| 910 | 910 | continue; |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | - $fields[ $result->id ] = $result; |
|
| 914 | - ++$count; |
|
| 913 | + $fields[$result->id] = $result; |
|
| 914 | + ++ $count; |
|
| 915 | 915 | |
| 916 | 916 | if ( $limit == 1 ) { |
| 917 | 917 | $fields = $result; |
@@ -966,8 +966,8 @@ discard block |
||
| 966 | 966 | $count = 0; |
| 967 | 967 | |
| 968 | 968 | foreach ( $results as $result ) { |
| 969 | - ++$count; |
|
| 970 | - $fields[ $result->id ] = $result; |
|
| 969 | + ++ $count; |
|
| 970 | + $fields[$result->id] = $result; |
|
| 971 | 971 | |
| 972 | 972 | if ( ! empty( $limit ) && $count >= $limit ) { |
| 973 | 973 | break; |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
| 1101 | 1101 | |
| 1102 | 1102 | if ( is_array( $where ) ) { |
| 1103 | - $args = array( |
|
| 1103 | + $args = array( |
|
| 1104 | 1104 | 'order_by' => $order_by, |
| 1105 | 1105 | 'limit' => $limit, |
| 1106 | 1106 | ); |
@@ -1137,9 +1137,9 @@ discard block |
||
| 1137 | 1137 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
| 1138 | 1138 | |
| 1139 | 1139 | self::prepare_options( $result ); |
| 1140 | - $results[ $r_key ]->field_options = $result->field_options; |
|
| 1141 | - $results[ $r_key ]->options = $result->options; |
|
| 1142 | - $results[ $r_key ]->default_value = $result->default_value; |
|
| 1140 | + $results[$r_key]->field_options = $result->field_options; |
|
| 1141 | + $results[$r_key]->options = $result->options; |
|
| 1142 | + $results[$r_key]->default_value = $result->default_value; |
|
| 1143 | 1143 | |
| 1144 | 1144 | unset( $r_key, $result ); |
| 1145 | 1145 | } |
@@ -1235,7 +1235,7 @@ discard block |
||
| 1235 | 1235 | |
| 1236 | 1236 | if ( count( $next_fields ) >= self::$transient_size ) { |
| 1237 | 1237 | // if this transient is full, check for another |
| 1238 | - ++$next; |
|
| 1238 | + ++ $next; |
|
| 1239 | 1239 | self::get_next_transient( $fields, $base_name, $next ); |
| 1240 | 1240 | } |
| 1241 | 1241 | } |
@@ -1271,7 +1271,7 @@ discard block |
||
| 1271 | 1271 | return; |
| 1272 | 1272 | } |
| 1273 | 1273 | |
| 1274 | - ++$next; |
|
| 1274 | + ++ $next; |
|
| 1275 | 1275 | } |
| 1276 | 1276 | } |
| 1277 | 1277 | |
@@ -1429,7 +1429,7 @@ discard block |
||
| 1429 | 1429 | * @return bool |
| 1430 | 1430 | */ |
| 1431 | 1431 | public static function is_option_true_in_array( $field, $option ) { |
| 1432 | - return ! empty( $field[ $option ] ); |
|
| 1432 | + return ! empty( $field[$option] ); |
|
| 1433 | 1433 | } |
| 1434 | 1434 | |
| 1435 | 1435 | /** |
@@ -1439,7 +1439,7 @@ discard block |
||
| 1439 | 1439 | * @return bool |
| 1440 | 1440 | */ |
| 1441 | 1441 | public static function is_option_true_in_object( $field, $option ) { |
| 1442 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
| 1442 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
| 1443 | 1443 | } |
| 1444 | 1444 | |
| 1445 | 1445 | /** |
@@ -1449,7 +1449,7 @@ discard block |
||
| 1449 | 1449 | * @return bool |
| 1450 | 1450 | */ |
| 1451 | 1451 | public static function is_option_empty_in_array( $field, $option ) { |
| 1452 | - return empty( $field[ $option ] ); |
|
| 1452 | + return empty( $field[$option] ); |
|
| 1453 | 1453 | } |
| 1454 | 1454 | |
| 1455 | 1455 | /** |
@@ -1459,7 +1459,7 @@ discard block |
||
| 1459 | 1459 | * @return bool |
| 1460 | 1460 | */ |
| 1461 | 1461 | public static function is_option_empty_in_object( $field, $option ) { |
| 1462 | - return empty( $field->field_options[ $option ] ); |
|
| 1462 | + return empty( $field->field_options[$option] ); |
|
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | 1465 | /** |
@@ -1469,7 +1469,7 @@ discard block |
||
| 1469 | 1469 | * @return bool |
| 1470 | 1470 | */ |
| 1471 | 1471 | public static function is_option_value_in_object( $field, $option ) { |
| 1472 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
| 1472 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
| 1473 | 1473 | } |
| 1474 | 1474 | |
| 1475 | 1475 | /** |
@@ -1491,10 +1491,10 @@ discard block |
||
| 1491 | 1491 | * @return mixed |
| 1492 | 1492 | */ |
| 1493 | 1493 | public static function get_option_in_array( $field, $option ) { |
| 1494 | - if ( isset( $field[ $option ] ) ) { |
|
| 1495 | - $this_option = $field[ $option ]; |
|
| 1496 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
| 1497 | - $this_option = $field['field_options'][ $option ]; |
|
| 1494 | + if ( isset( $field[$option] ) ) { |
|
| 1495 | + $this_option = $field[$option]; |
|
| 1496 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
| 1497 | + $this_option = $field['field_options'][$option]; |
|
| 1498 | 1498 | } else { |
| 1499 | 1499 | $this_option = ''; |
| 1500 | 1500 | } |
@@ -1509,7 +1509,7 @@ discard block |
||
| 1509 | 1509 | * @return mixed |
| 1510 | 1510 | */ |
| 1511 | 1511 | public static function get_option_in_object( $field, $option ) { |
| 1512 | - return $field->field_options[ $option ] ?? ''; |
|
| 1512 | + return $field->field_options[$option] ?? ''; |
|
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | 1515 | /** |