@@ -7,17 +7,17 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Prepare the company name. |
13 | -$company_name = wpinv_get_option( 'vat_company_name' ); |
|
13 | +$company_name = wpinv_get_option('vat_company_name'); |
|
14 | 14 | |
15 | -if ( empty( $company_name ) ) { |
|
15 | +if (empty($company_name)) { |
|
16 | 16 | $company_name = wpinv_get_business_name(); |
17 | 17 | } |
18 | 18 | |
19 | 19 | // Prepare the VAT number. |
20 | -$vat_number = wpinv_get_option( 'vat_number' ); |
|
20 | +$vat_number = wpinv_get_option('vat_number'); |
|
21 | 21 | |
22 | 22 | ?> |
23 | 23 | <div class="getpaid-company-address form-group"> |
@@ -25,36 +25,36 @@ discard block |
||
25 | 25 | <div class="row"> |
26 | 26 | |
27 | 27 | <div class="invoice-company-address-label col-2"> |
28 | - <strong><?php _e( 'From:', 'invoicing' ); ?></strong> |
|
28 | + <strong><?php _e('From:', 'invoicing'); ?></strong> |
|
29 | 29 | </div> |
30 | 30 | |
31 | 31 | <div class="invoice-company-address-value col-10"> |
32 | 32 | |
33 | - <?php do_action( 'getpaid_company_address_top' ); ?> |
|
33 | + <?php do_action('getpaid_company_address_top'); ?> |
|
34 | 34 | |
35 | 35 | <div class="name"> |
36 | - <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
37 | - <?php echo esc_html( $company_name ); ?> |
|
36 | + <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
37 | + <?php echo esc_html($company_name); ?> |
|
38 | 38 | </a> |
39 | 39 | </div> |
40 | 40 | |
41 | - <?php if ( $address = wpinv_get_business_address() ) { ?> |
|
42 | - <?php echo wp_kses_post( $address ); ?> |
|
41 | + <?php if ($address = wpinv_get_business_address()) { ?> |
|
42 | + <?php echo wp_kses_post($address); ?> |
|
43 | 43 | <?php } ?> |
44 | 44 | |
45 | - <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?> |
|
45 | + <?php if ($email_from = wpinv_mail_get_from_address()) { ?> |
|
46 | 46 | <div class="email_from"> |
47 | - <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), sanitize_email( $email_from ) ); ?> |
|
47 | + <?php echo wp_sprintf(__('Email: %s', 'invoicing'), sanitize_email($email_from)); ?> |
|
48 | 48 | </div> |
49 | 49 | <?php } ?> |
50 | 50 | |
51 | - <?php if ( ! empty( $vat_number ) ) { ?> |
|
51 | + <?php if (!empty($vat_number)) { ?> |
|
52 | 52 | <div class="email_from"> |
53 | - <?php echo wp_sprintf( __( 'VAT Number: %s', 'invoicing' ), esc_html( $vat_number ) ); ?> |
|
53 | + <?php echo wp_sprintf(__('VAT Number: %s', 'invoicing'), esc_html($vat_number)); ?> |
|
54 | 54 | </div> |
55 | 55 | <?php } ?> |
56 | 56 | |
57 | - <?php do_action( 'getpaid_company_address_bottom' ); ?> |
|
57 | + <?php do_action('getpaid_company_address_bottom'); ?> |
|
58 | 58 | |
59 | 59 | </div> |
60 | 60 |
@@ -33,12 +33,12 @@ |
||
33 | 33 | |
34 | 34 | // Display the item totals. |
35 | 35 | foreach ( $invoice->get_items() as $item ) { |
36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
36 | + wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Display the fee totals. |
40 | 40 | foreach ( $invoice->get_fees() as $fee ) { |
41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
41 | + wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // Display the cart totals. |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | * @var WPInv_Invoice $invoice |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | |
15 | -<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
15 | +<?php do_action('getpaid_invoice_before_line_items', $invoice); ?> |
|
16 | 16 | |
17 | - <h2 class="mt-5 mb-1 h4"><?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?></h2> |
|
17 | + <h2 class="mt-5 mb-1 h4"><?php echo sprintf(esc_html__('%s Items', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?></h2> |
|
18 | 18 | <div class="getpaid-invoice-items mb-4 border"> |
19 | 19 | |
20 | 20 | |
21 | - <div class="getpaid-invoice-items-header <?php echo sanitize_html_class( $invoice->get_template() ); ?>"> |
|
21 | + <div class="getpaid-invoice-items-header <?php echo sanitize_html_class($invoice->get_template()); ?>"> |
|
22 | 22 | <div class="form-row"> |
23 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
24 | - <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr( $key ); ?>"> |
|
25 | - <?php echo esc_html( $label ); ?> |
|
23 | + <?php foreach ($columns as $key => $label) : ?> |
|
24 | + <div class="<?php echo 'name' == $key ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-line-item-col-<?php echo esc_attr($key); ?>"> |
|
25 | + <?php echo esc_html($label); ?> |
|
26 | 26 | </div> |
27 | 27 | <?php endforeach; ?> |
28 | 28 | </div> |
@@ -32,20 +32,20 @@ discard block |
||
32 | 32 | <?php |
33 | 33 | |
34 | 34 | // Display the item totals. |
35 | - foreach ( $invoice->get_items() as $item ) { |
|
36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
35 | + foreach ($invoice->get_items() as $item) { |
|
36 | + wpinv_get_template('invoice/line-item.php', compact('invoice', 'item', 'columns')); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Display the fee totals. |
40 | - foreach ( $invoice->get_fees() as $fee ) { |
|
41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
40 | + foreach ($invoice->get_fees() as $fee) { |
|
41 | + wpinv_get_template('invoice/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | // Display the cart totals. |
45 | - wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
45 | + wpinv_get_template('invoice/line-totals.php', compact('invoice')); |
|
46 | 46 | |
47 | 47 | ?> |
48 | 48 | |
49 | 49 | </div> |
50 | 50 | |
51 | -<?php do_action( 'getpaid_invoice_after_line_items', $invoice ); ?> |
|
51 | +<?php do_action('getpaid_invoice_after_line_items', $invoice); ?> |
@@ -7,24 +7,24 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$logo_width = wpinv_get_option( 'logo_width' ); |
|
13 | -$logo_height = wpinv_get_option( 'logo_height' ); |
|
12 | +$logo_width = wpinv_get_option('logo_width'); |
|
13 | +$logo_height = wpinv_get_option('logo_height'); |
|
14 | 14 | |
15 | 15 | ?> |
16 | -<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
16 | +<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>"> |
|
17 | 17 | |
18 | - <?php if ( $logo = wpinv_get_business_logo() ) : ?> |
|
18 | + <?php if ($logo = wpinv_get_business_logo()) : ?> |
|
19 | 19 | |
20 | - <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
|
21 | - <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
|
20 | + <?php if (!empty($logo_width) && !empty($logo_height)) : ?> |
|
21 | + <img class="logo" style="max-width:100%; width:<?php echo absint($logo_width); ?>px; height:<?php echo absint($logo_height); ?>px;" src="<?php echo esc_url($logo); ?>"> |
|
22 | 22 | <?php else : ?> |
23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
23 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url($logo); ?>"> |
|
24 | 24 | <?php endif; ?> |
25 | 25 | |
26 | 26 | <?php else : ?> |
27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
27 | + <h1 class="h3"><?php echo esc_html(wpinv_get_business_name()); ?></h1> |
|
28 | 28 | <?php endif; ?> |
29 | 29 | |
30 | 30 | </a> |
@@ -19,12 +19,18 @@ |
||
19 | 19 | |
20 | 20 | <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
21 | 21 | <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
22 | - <?php else : ?> |
|
23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
22 | + <?php else { |
|
23 | + : ?> |
|
24 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); |
|
25 | +} |
|
26 | +?>"> |
|
24 | 27 | <?php endif; ?> |
25 | 28 | |
26 | - <?php else : ?> |
|
27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
29 | + <?php else { |
|
30 | + : ?> |
|
31 | + <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); |
|
32 | +} |
|
33 | +?></h1> |
|
28 | 34 | <?php endif; ?> |
29 | 35 | |
30 | 36 | </a> |
@@ -40,19 +40,19 @@ |
||
40 | 40 | <?php |
41 | 41 | |
42 | 42 | if ( ! $invoice->exists() || $invoice->is_draft() ) { |
43 | - $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
43 | + $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
44 | 44 | } else { |
45 | 45 | |
46 | - $user_id = get_current_user_id(); |
|
47 | - if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
48 | - $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
49 | - $error .= sprintf( |
|
50 | - ' <a href="%s">%s</a>', |
|
51 | - wp_login_url( $invoice->get_view_url() ), |
|
52 | - __( 'Login.', 'invoicing' ) |
|
53 | - ); |
|
54 | - } else { |
|
55 | - $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
46 | + $user_id = get_current_user_id(); |
|
47 | + if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
48 | + $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
49 | + $error .= sprintf( |
|
50 | + ' <a href="%s">%s</a>', |
|
51 | + wp_login_url( $invoice->get_view_url() ), |
|
52 | + __( 'Login.', 'invoicing' ) |
|
53 | + ); |
|
54 | + } else { |
|
55 | + $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 |
@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Fetch the invoice. |
13 | -if ( empty( $invoice ) ) { |
|
14 | - $invoice = new WPInv_Invoice( $GLOBALS['post'] ); |
|
13 | +if (empty($invoice)) { |
|
14 | + $invoice = new WPInv_Invoice($GLOBALS['post']); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | ?><!DOCTYPE html> |
@@ -21,16 +21,16 @@ discard block |
||
21 | 21 | |
22 | 22 | <head> |
23 | 23 | |
24 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
24 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
25 | 25 | <meta name="viewport" content="width=device-width, initial-scale=1.0" > |
26 | 26 | |
27 | 27 | <meta name="robots" content="noindex,nofollow"> |
28 | 28 | |
29 | 29 | <link rel="profile" href="https://gmpg.org/xfn/11"> |
30 | 30 | |
31 | - <title><?php _e( 'Invalid Access', 'invoicing' ); ?></title> |
|
31 | + <title><?php _e('Invalid Access', 'invoicing'); ?></title> |
|
32 | 32 | |
33 | - <?php do_action( 'wpinv_invoice_print_head', $invoice ); ?> |
|
33 | + <?php do_action('wpinv_invoice_print_head', $invoice); ?> |
|
34 | 34 | |
35 | 35 | </head> |
36 | 36 | |
@@ -39,20 +39,20 @@ discard block |
||
39 | 39 | |
40 | 40 | <?php |
41 | 41 | |
42 | - if ( ! $invoice->exists() || $invoice->is_draft() ) { |
|
43 | - $error = __( 'This invoice was deleted or is not visible.', 'invoicing' ); |
|
42 | + if (!$invoice->exists() || $invoice->is_draft()) { |
|
43 | + $error = __('This invoice was deleted or is not visible.', 'invoicing'); |
|
44 | 44 | } else { |
45 | 45 | |
46 | 46 | $user_id = get_current_user_id(); |
47 | - if ( wpinv_require_login_to_checkout() && empty( $user_id ) ) { |
|
48 | - $error = __( 'You must be logged in to view this invoice.', 'invoicing' ); |
|
47 | + if (wpinv_require_login_to_checkout() && empty($user_id)) { |
|
48 | + $error = __('You must be logged in to view this invoice.', 'invoicing'); |
|
49 | 49 | $error .= sprintf( |
50 | 50 | ' <a href="%s">%s</a>', |
51 | - wp_login_url( $invoice->get_view_url() ), |
|
52 | - __( 'Login.', 'invoicing' ) |
|
51 | + wp_login_url($invoice->get_view_url()), |
|
52 | + __('Login.', 'invoicing') |
|
53 | 53 | ); |
54 | 54 | } else { |
55 | - $error = __( 'This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing' ); |
|
55 | + $error = __('This invoice is only viewable by clicking on the invoice link that was sent to you via email.', 'invoicing'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | <div class="container"> |
62 | 62 | <div class="alert alert-danger m-5" role="alert"> |
63 | - <h4 class="alert-heading"><?php _e( 'Access Denied', 'invoicing' ); ?></h4> |
|
64 | - <p><?php echo wp_kses_post( $error ); ?></p> |
|
63 | + <h4 class="alert-heading"><?php _e('Access Denied', 'invoicing'); ?></h4> |
|
64 | + <p><?php echo wp_kses_post($error); ?></p> |
|
65 | 65 | </div> |
66 | 66 | </div> |
67 | 67 |
@@ -13,42 +13,42 @@ |
||
13 | 13 | |
14 | 14 | foreach ( array_keys( $widget->get_subscriptions_table_columns() ) as $column ) : |
15 | 15 | |
16 | - $class = sanitize_html_class( $column ); |
|
17 | - echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
|
16 | + $class = sanitize_html_class( $column ); |
|
17 | + echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
|
18 | 18 | |
19 | - do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
19 | + do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
20 | 20 | |
21 | - switch ( $column ) : |
|
21 | + switch ( $column ) : |
|
22 | 22 | |
23 | - case 'subscription': |
|
24 | - $subscription_id = (int) $subscription->get_id(); |
|
25 | - $url = esc_url( $subscription->get_view_url() ); |
|
26 | - $id_label = sprintf( |
|
27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
28 | - (int) $subscription->get_id() |
|
29 | - ); |
|
30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
31 | - break; |
|
23 | + case 'subscription': |
|
24 | + $subscription_id = (int) $subscription->get_id(); |
|
25 | + $url = esc_url( $subscription->get_view_url() ); |
|
26 | + $id_label = sprintf( |
|
27 | + esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
28 | + (int) $subscription->get_id() |
|
29 | + ); |
|
30 | + echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
31 | + break; |
|
32 | 32 | |
33 | - case 'status': |
|
34 | - echo esc_html( $subscription->get_status_label() ); |
|
35 | - break; |
|
33 | + case 'status': |
|
34 | + echo esc_html( $subscription->get_status_label() ); |
|
35 | + break; |
|
36 | 36 | |
37 | - case 'renewal-date': |
|
38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
39 | - echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
40 | - break; |
|
37 | + case 'renewal-date': |
|
38 | + $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
39 | + echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
40 | + break; |
|
41 | 41 | |
42 | - case 'amount': |
|
43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
46 | - break; |
|
42 | + case 'amount': |
|
43 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
44 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
45 | + echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
46 | + break; |
|
47 | 47 | |
48 | - endswitch; |
|
48 | + endswitch; |
|
49 | 49 | |
50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
50 | + do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
51 | 51 | |
52 | - echo '</td>'; |
|
52 | + echo '</td>'; |
|
53 | 53 | |
54 | 54 | endforeach; |
@@ -20,35 +20,35 @@ |
||
20 | 20 | |
21 | 21 | switch ( $column ) : |
22 | 22 | |
23 | - case 'subscription': |
|
24 | - $subscription_id = (int) $subscription->get_id(); |
|
25 | - $url = esc_url( $subscription->get_view_url() ); |
|
26 | - $id_label = sprintf( |
|
27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
28 | - (int) $subscription->get_id() |
|
29 | - ); |
|
30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
31 | - break; |
|
32 | - |
|
33 | - case 'status': |
|
34 | - echo esc_html( $subscription->get_status_label() ); |
|
35 | - break; |
|
36 | - |
|
37 | - case 'renewal-date': |
|
38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
39 | - echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
40 | - break; |
|
41 | - |
|
42 | - case 'amount': |
|
43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
46 | - break; |
|
47 | - |
|
48 | - endswitch; |
|
49 | - |
|
50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
51 | - |
|
52 | - echo '</td>'; |
|
53 | - |
|
54 | -endforeach; |
|
23 | + case 'subscription': |
|
24 | + $subscription_id = (int) $subscription->get_id(); |
|
25 | + $url = esc_url( $subscription->get_view_url() ); |
|
26 | + $id_label = sprintf( |
|
27 | + esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
28 | + (int) $subscription->get_id() |
|
29 | + ); |
|
30 | + echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
31 | + break; |
|
32 | + |
|
33 | + case 'status': |
|
34 | + echo esc_html( $subscription->get_status_label() ); |
|
35 | + break; |
|
36 | + |
|
37 | + case 'renewal-date': |
|
38 | + $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
39 | + echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
40 | + break; |
|
41 | + |
|
42 | + case 'amount': |
|
43 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
44 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
45 | + echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
46 | + break; |
|
47 | + |
|
48 | + endswitch; |
|
49 | + |
|
50 | + do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
51 | + |
|
52 | + echo '</td>'; |
|
53 | + |
|
54 | + endforeach; |
@@ -9,45 +9,45 @@ |
||
9 | 9 | * @var WPInv_Subscriptions_Widget $widget |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | -foreach ( array_keys( $widget->get_subscriptions_table_columns() ) as $column ) : |
|
14 | +foreach (array_keys($widget->get_subscriptions_table_columns()) as $column) : |
|
15 | 15 | |
16 | - $class = sanitize_html_class( $column ); |
|
16 | + $class = sanitize_html_class($column); |
|
17 | 17 | echo "<td class='getpaid-subscriptions-table-column-$class'>"; |
18 | 18 | |
19 | - do_action( "getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription ); |
|
19 | + do_action("getpaid_subscriptions_before_frontend_subscription_table_$column", $subscription); |
|
20 | 20 | |
21 | - switch ( $column ) : |
|
21 | + switch ($column) : |
|
22 | 22 | |
23 | 23 | case 'subscription': |
24 | 24 | $subscription_id = (int) $subscription->get_id(); |
25 | - $url = esc_url( $subscription->get_view_url() ); |
|
25 | + $url = esc_url($subscription->get_view_url()); |
|
26 | 26 | $id_label = sprintf( |
27 | - esc_attr_x( '#%s', 'subscription id', 'invoicing' ), |
|
27 | + esc_attr_x('#%s', 'subscription id', 'invoicing'), |
|
28 | 28 | (int) $subscription->get_id() |
29 | 29 | ); |
30 | - echo $widget->add_row_actions( "<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription ); |
|
30 | + echo $widget->add_row_actions("<a href='$url' class='font-weight-bold text-decoration-none'>$id_label</a>", $subscription); |
|
31 | 31 | break; |
32 | 32 | |
33 | 33 | case 'status': |
34 | - echo esc_html( $subscription->get_status_label() ); |
|
34 | + echo esc_html($subscription->get_status_label()); |
|
35 | 35 | break; |
36 | 36 | |
37 | 37 | case 'renewal-date': |
38 | - $renewal = getpaid_format_date_value( $subscription->get_next_renewal_date() ); |
|
39 | - echo $subscription->is_active() ? esc_html( $renewal ) : '—'; |
|
38 | + $renewal = getpaid_format_date_value($subscription->get_next_renewal_date()); |
|
39 | + echo $subscription->is_active() ? esc_html($renewal) : '—'; |
|
40 | 40 | break; |
41 | 41 | |
42 | 42 | case 'amount': |
43 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
44 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
45 | - echo wp_kses_post( "<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>" ); |
|
43 | + $frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency(), ''); |
|
44 | + $amount = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency()); |
|
45 | + echo wp_kses_post("<span>$amount</span> / <span class='getpaid-item-recurring-period'>$frequency</span>"); |
|
46 | 46 | break; |
47 | 47 | |
48 | 48 | endswitch; |
49 | 49 | |
50 | - do_action( "getpaid_subscriptions_frontend_subscription_table_$column", $subscription ); |
|
50 | + do_action("getpaid_subscriptions_frontend_subscription_table_$column", $subscription); |
|
51 | 51 | |
52 | 52 | echo '</td>'; |
53 | 53 |
@@ -46,62 +46,62 @@ discard block |
||
46 | 46 | <td style="width: 65%"> |
47 | 47 | <?php |
48 | 48 | |
49 | - switch ( $key ) { |
|
49 | + switch ( $key ) { |
|
50 | 50 | |
51 | - case 'status': |
|
52 | - echo esc_html( $subscription->get_status_label() ); |
|
53 | - break; |
|
51 | + case 'status': |
|
52 | + echo esc_html( $subscription->get_status_label() ); |
|
53 | + break; |
|
54 | 54 | |
55 | - case 'start_date': |
|
56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
57 | - break; |
|
55 | + case 'start_date': |
|
56 | + echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
57 | + break; |
|
58 | 58 | |
59 | - case 'expiry_date': |
|
60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
61 | - break; |
|
59 | + case 'expiry_date': |
|
60 | + echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
61 | + break; |
|
62 | 62 | |
63 | - case 'initial_amount': |
|
64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
63 | + case 'initial_amount': |
|
64 | + echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
65 | 65 | |
66 | - if ( $subscription->has_trial_period() ) { |
|
66 | + if ( $subscription->has_trial_period() ) { |
|
67 | 67 | |
68 | - echo "<small class='text-muted'> "; |
|
69 | - printf( |
|
70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
71 | - esc_html( $subscription->get_trial_period() ) |
|
72 | - ); |
|
73 | - echo '</small>'; |
|
68 | + echo "<small class='text-muted'> "; |
|
69 | + printf( |
|
70 | + _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
71 | + esc_html( $subscription->get_trial_period() ) |
|
72 | + ); |
|
73 | + echo '</small>'; |
|
74 | 74 | |
75 | - } |
|
75 | + } |
|
76 | 76 | |
77 | - break; |
|
77 | + break; |
|
78 | 78 | |
79 | - case 'recurring_amount': |
|
80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
83 | - break; |
|
79 | + case 'recurring_amount': |
|
80 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
81 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
82 | + echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
83 | + break; |
|
84 | 84 | |
85 | - case 'item': |
|
86 | - if ( empty( $subscription_group ) ) { |
|
87 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
88 | - } else { |
|
89 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
90 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
91 | - } |
|
85 | + case 'item': |
|
86 | + if ( empty( $subscription_group ) ) { |
|
87 | + echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
88 | + } else { |
|
89 | + $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
90 | + echo wp_kses_post( implode( ' | ', $markup ) ); |
|
91 | + } |
|
92 | 92 | |
93 | - break; |
|
93 | + break; |
|
94 | 94 | |
95 | - case 'payments': |
|
96 | - $max_activations = (int) $subscription->get_bill_times(); |
|
97 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
95 | + case 'payments': |
|
96 | + $max_activations = (int) $subscription->get_bill_times(); |
|
97 | + echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
98 | 98 | |
99 | - break; |
|
99 | + break; |
|
100 | 100 | |
101 | - } |
|
102 | - do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
101 | + } |
|
102 | + do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
103 | 103 | |
104 | - ?> |
|
104 | + ?> |
|
105 | 105 | </td> |
106 | 106 | |
107 | 107 | </tr> |
@@ -128,17 +128,17 @@ discard block |
||
128 | 128 | <span class="form-text"> |
129 | 129 | |
130 | 130 | <?php |
131 | - if ( $subscription->can_cancel() ) { |
|
132 | - printf( |
|
133 | - '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
|
134 | - esc_url( $subscription->get_cancel_url() ), |
|
135 | - esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
136 | - __( 'Cancel Subscription', 'invoicing' ) |
|
137 | - ); |
|
138 | - } |
|
139 | - |
|
140 | - do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
141 | - ?> |
|
131 | + if ( $subscription->can_cancel() ) { |
|
132 | + printf( |
|
133 | + '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
|
134 | + esc_url( $subscription->get_cancel_url() ), |
|
135 | + esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
136 | + __( 'Cancel Subscription', 'invoicing' ) |
|
137 | + ); |
|
138 | + } |
|
139 | + |
|
140 | + do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
141 | + ?> |
|
142 | 142 | |
143 | 143 | <a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php _e( 'Go Back', 'invoicing' ); ?></a> |
144 | 144 | </span> |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php |
|
1 | + <?php |
|
2 | 2 | /** |
3 | 3 | * Template that prints a single subscription's details |
4 | 4 | * |
@@ -9,19 +9,19 @@ discard block |
||
9 | 9 | * @var WPInv_Subscriptions_Widget $widget |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | + defined( 'ABSPATH' ) || exit; |
|
13 | 13 | |
14 | -do_action( 'getpaid_single_subscription_before_notices', $subscription ); |
|
14 | + do_action( 'getpaid_single_subscription_before_notices', $subscription ); |
|
15 | 15 | |
16 | -// Display errors and notices. |
|
17 | -wpinv_print_errors(); |
|
16 | + // Display errors and notices. |
|
17 | + wpinv_print_errors(); |
|
18 | 18 | |
19 | -$subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() ); |
|
20 | -$subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
19 | + $subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() ); |
|
20 | + $subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
21 | 21 | |
22 | -do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups ); |
|
22 | + do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups ); |
|
23 | 23 | |
24 | -?> |
|
24 | + ?> |
|
25 | 25 | |
26 | 26 | <style> |
27 | 27 | .entry-header, |
@@ -46,59 +46,59 @@ discard block |
||
46 | 46 | <td style="width: 65%"> |
47 | 47 | <?php |
48 | 48 | |
49 | - switch ( $key ) { |
|
49 | + switch ( $key ) { |
|
50 | 50 | |
51 | - case 'status': |
|
52 | - echo esc_html( $subscription->get_status_label() ); |
|
53 | - break; |
|
51 | + case 'status': |
|
52 | + echo esc_html( $subscription->get_status_label() ); |
|
53 | + break; |
|
54 | 54 | |
55 | - case 'start_date': |
|
56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
57 | - break; |
|
55 | + case 'start_date': |
|
56 | + echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
57 | + break; |
|
58 | 58 | |
59 | - case 'expiry_date': |
|
60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
61 | - break; |
|
59 | + case 'expiry_date': |
|
60 | + echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
61 | + break; |
|
62 | 62 | |
63 | - case 'initial_amount': |
|
64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
63 | + case 'initial_amount': |
|
64 | + echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
65 | 65 | |
66 | - if ( $subscription->has_trial_period() ) { |
|
66 | + if ( $subscription->has_trial_period() ) { |
|
67 | 67 | |
68 | - echo "<small class='text-muted'> "; |
|
69 | - printf( |
|
70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
71 | - esc_html( $subscription->get_trial_period() ) |
|
72 | - ); |
|
73 | - echo '</small>'; |
|
68 | + echo "<small class='text-muted'> "; |
|
69 | + printf( |
|
70 | + _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
71 | + esc_html( $subscription->get_trial_period() ) |
|
72 | + ); |
|
73 | + echo '</small>'; |
|
74 | 74 | |
75 | - } |
|
75 | + } |
|
76 | 76 | |
77 | - break; |
|
77 | + break; |
|
78 | 78 | |
79 | - case 'recurring_amount': |
|
80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
83 | - break; |
|
79 | + case 'recurring_amount': |
|
80 | + $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
81 | + $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
82 | + echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
83 | + break; |
|
84 | 84 | |
85 | - case 'item': |
|
86 | - if ( empty( $subscription_group ) ) { |
|
87 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
88 | - } else { |
|
89 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
90 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
91 | - } |
|
85 | + case 'item': |
|
86 | + if ( empty( $subscription_group ) ) { |
|
87 | + echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
88 | + } else { |
|
89 | + $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
90 | + echo wp_kses_post( implode( ' | ', $markup ) ); |
|
91 | + } |
|
92 | 92 | |
93 | - break; |
|
93 | + break; |
|
94 | 94 | |
95 | - case 'payments': |
|
96 | - $max_activations = (int) $subscription->get_bill_times(); |
|
97 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
95 | + case 'payments': |
|
96 | + $max_activations = (int) $subscription->get_bill_times(); |
|
97 | + echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
98 | 98 | |
99 | - break; |
|
99 | + break; |
|
100 | 100 | |
101 | - } |
|
101 | + } |
|
102 | 102 | do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
103 | 103 | |
104 | 104 | ?> |
@@ -9,17 +9,17 @@ discard block |
||
9 | 9 | * @var WPInv_Subscriptions_Widget $widget |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | -do_action( 'getpaid_single_subscription_before_notices', $subscription ); |
|
14 | +do_action('getpaid_single_subscription_before_notices', $subscription); |
|
15 | 15 | |
16 | 16 | // Display errors and notices. |
17 | 17 | wpinv_print_errors(); |
18 | 18 | |
19 | -$subscription_groups = getpaid_get_invoice_subscription_groups( $subscription->get_parent_invoice_id() ); |
|
20 | -$subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
19 | +$subscription_groups = getpaid_get_invoice_subscription_groups($subscription->get_parent_invoice_id()); |
|
20 | +$subscription_group = getpaid_get_invoice_subscription_group($subscription->get_parent_invoice_id(), $subscription->get_id()); |
|
21 | 21 | |
22 | -do_action( 'getpaid_before_single_subscription', $subscription, $subscription_groups ); |
|
22 | +do_action('getpaid_before_single_subscription', $subscription, $subscription_groups); |
|
23 | 23 | |
24 | 24 | ?> |
25 | 25 | |
@@ -31,44 +31,44 @@ discard block |
||
31 | 31 | |
32 | 32 | </style> |
33 | 33 | |
34 | -<h2 class="mb-1 h4"><?php _e( 'Subscription Details', 'invoicing' ); ?></h2> |
|
34 | +<h2 class="mb-1 h4"><?php _e('Subscription Details', 'invoicing'); ?></h2> |
|
35 | 35 | <table class="table table-bordered"> |
36 | 36 | <tbody> |
37 | 37 | |
38 | - <?php foreach ( $widget->get_single_subscription_columns( $subscription ) as $key => $label ) : ?> |
|
38 | + <?php foreach ($widget->get_single_subscription_columns($subscription) as $key => $label) : ?> |
|
39 | 39 | |
40 | - <tr class="getpaid-subscription-meta-<?php echo sanitize_html_class( $key ); ?>"> |
|
40 | + <tr class="getpaid-subscription-meta-<?php echo sanitize_html_class($key); ?>"> |
|
41 | 41 | |
42 | 42 | <th class="font-weight-bold" style="width: 35%"> |
43 | - <?php echo esc_html( $label ); ?> |
|
43 | + <?php echo esc_html($label); ?> |
|
44 | 44 | </th> |
45 | 45 | |
46 | 46 | <td style="width: 65%"> |
47 | 47 | <?php |
48 | 48 | |
49 | - switch ( $key ) { |
|
49 | + switch ($key) { |
|
50 | 50 | |
51 | 51 | case 'status': |
52 | - echo esc_html( $subscription->get_status_label() ); |
|
52 | + echo esc_html($subscription->get_status_label()); |
|
53 | 53 | break; |
54 | 54 | |
55 | 55 | case 'start_date': |
56 | - echo esc_html( getpaid_format_date_value( $subscription->get_date_created() ) ); |
|
56 | + echo esc_html(getpaid_format_date_value($subscription->get_date_created())); |
|
57 | 57 | break; |
58 | 58 | |
59 | 59 | case 'expiry_date': |
60 | - echo esc_html( getpaid_format_date_value( $subscription->get_next_renewal_date() ) ); |
|
60 | + echo esc_html(getpaid_format_date_value($subscription->get_next_renewal_date())); |
|
61 | 61 | break; |
62 | 62 | |
63 | 63 | case 'initial_amount': |
64 | - echo wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
64 | + echo wpinv_price($subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency()); |
|
65 | 65 | |
66 | - if ( $subscription->has_trial_period() ) { |
|
66 | + if ($subscription->has_trial_period()) { |
|
67 | 67 | |
68 | 68 | echo "<small class='text-muted'> "; |
69 | 69 | printf( |
70 | - _x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
71 | - esc_html( $subscription->get_trial_period() ) |
|
70 | + _x('( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing'), |
|
71 | + esc_html($subscription->get_trial_period()) |
|
72 | 72 | ); |
73 | 73 | echo '</small>'; |
74 | 74 | |
@@ -77,29 +77,29 @@ discard block |
||
77 | 77 | break; |
78 | 78 | |
79 | 79 | case 'recurring_amount': |
80 | - $frequency = getpaid_get_subscription_period_label( $subscription->get_period(), $subscription->get_frequency(), '' ); |
|
81 | - $amount = wpinv_price( $subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency() ); |
|
82 | - echo wp_kses_post( strtolower( "<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>" ) ); |
|
80 | + $frequency = getpaid_get_subscription_period_label($subscription->get_period(), $subscription->get_frequency(), ''); |
|
81 | + $amount = wpinv_price($subscription->get_recurring_amount(), $subscription->get_parent_payment()->get_currency()); |
|
82 | + echo wp_kses_post(strtolower("<strong style='font-weight: 500;'>$amount</strong> / <span class='getpaid-item-recurring-period'>$frequency</span>")); |
|
83 | 83 | break; |
84 | 84 | |
85 | 85 | case 'item': |
86 | - if ( empty( $subscription_group ) ) { |
|
87 | - echo wp_kses_post( WPInv_Subscriptions_List_Table::generate_item_markup( $subscription->get_product_id() ) ); |
|
86 | + if (empty($subscription_group)) { |
|
87 | + echo wp_kses_post(WPInv_Subscriptions_List_Table::generate_item_markup($subscription->get_product_id())); |
|
88 | 88 | } else { |
89 | - $markup = array_map( array( 'WPInv_Subscriptions_List_Table', 'generate_item_markup' ), array_keys( $subscription_group['items'] ) ); |
|
90 | - echo wp_kses_post( implode( ' | ', $markup ) ); |
|
89 | + $markup = array_map(array('WPInv_Subscriptions_List_Table', 'generate_item_markup'), array_keys($subscription_group['items'])); |
|
90 | + echo wp_kses_post(implode(' | ', $markup)); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | break; |
94 | 94 | |
95 | 95 | case 'payments': |
96 | 96 | $max_activations = (int) $subscription->get_bill_times(); |
97 | - echo ( (int) $subscription->get_times_billed() ) . ' / ' . ( empty( $max_activations ) ? '∞' : (int) $max_activations ); |
|
97 | + echo ((int) $subscription->get_times_billed()) . ' / ' . (empty($max_activations) ? '∞' : (int) $max_activations); |
|
98 | 98 | |
99 | 99 | break; |
100 | 100 | |
101 | 101 | } |
102 | - do_action( "getpaid_render_single_subscription_column_$key", $subscription ); |
|
102 | + do_action("getpaid_render_single_subscription_column_$key", $subscription); |
|
103 | 103 | |
104 | 104 | ?> |
105 | 105 | </td> |
@@ -111,34 +111,34 @@ discard block |
||
111 | 111 | </tbody> |
112 | 112 | </table> |
113 | 113 | |
114 | -<?php if ( ! empty( $subscription_group ) ) : ?> |
|
115 | - <h2 class='mt-5 mb-1 h4'><?php _e( 'Subscription Items', 'invoicing' ); ?></h2> |
|
116 | - <?php getpaid_admin_subscription_item_details_metabox( $subscription ); ?> |
|
114 | +<?php if (!empty($subscription_group)) : ?> |
|
115 | + <h2 class='mt-5 mb-1 h4'><?php _e('Subscription Items', 'invoicing'); ?></h2> |
|
116 | + <?php getpaid_admin_subscription_item_details_metabox($subscription); ?> |
|
117 | 117 | <?php endif; ?> |
118 | 118 | |
119 | -<h2 class='mt-5 mb-1 h4'><?php _e( 'Related Invoices', 'invoicing' ); ?></h2> |
|
119 | +<h2 class='mt-5 mb-1 h4'><?php _e('Related Invoices', 'invoicing'); ?></h2> |
|
120 | 120 | |
121 | -<?php echo getpaid_admin_subscription_invoice_details_metabox( $subscription ); ?> |
|
121 | +<?php echo getpaid_admin_subscription_invoice_details_metabox($subscription); ?> |
|
122 | 122 | |
123 | -<?php if ( 1 < count( $subscription_groups ) ) : ?> |
|
124 | - <h2 class='mt-5 mb-1 h4'><?php _e( 'Related Subscriptions', 'invoicing' ); ?></h2> |
|
125 | - <?php getpaid_admin_subscription_related_subscriptions_metabox( $subscription ); ?> |
|
123 | +<?php if (1 < count($subscription_groups)) : ?> |
|
124 | + <h2 class='mt-5 mb-1 h4'><?php _e('Related Subscriptions', 'invoicing'); ?></h2> |
|
125 | + <?php getpaid_admin_subscription_related_subscriptions_metabox($subscription); ?> |
|
126 | 126 | <?php endif; ?> |
127 | 127 | |
128 | 128 | <span class="form-text"> |
129 | 129 | |
130 | 130 | <?php |
131 | - if ( $subscription->can_cancel() ) { |
|
131 | + if ($subscription->can_cancel()) { |
|
132 | 132 | printf( |
133 | 133 | '<a href="%s" class="btn btn-danger btn-sm" onclick="return confirm(\'%s\')">%s</a> ', |
134 | - esc_url( $subscription->get_cancel_url() ), |
|
135 | - esc_attr__( 'Are you sure you want to cancel this subscription?', 'invoicing' ), |
|
136 | - __( 'Cancel Subscription', 'invoicing' ) |
|
134 | + esc_url($subscription->get_cancel_url()), |
|
135 | + esc_attr__('Are you sure you want to cancel this subscription?', 'invoicing'), |
|
136 | + __('Cancel Subscription', 'invoicing') |
|
137 | 137 | ); |
138 | 138 | } |
139 | 139 | |
140 | - do_action( 'getpaid-single-subscription-page-actions', $subscription ); |
|
140 | + do_action('getpaid-single-subscription-page-actions', $subscription); |
|
141 | 141 | ?> |
142 | 142 | |
143 | - <a href="<?php echo esc_url( getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ) ); ?>" class="btn btn-secondary btn-sm"><?php _e( 'Go Back', 'invoicing' ); ?></a> |
|
143 | + <a href="<?php echo esc_url(getpaid_get_tab_url('gp-subscriptions', get_permalink((int) wpinv_get_option('invoice_subscription_page')))); ?>" class="btn btn-secondary btn-sm"><?php _e('Go Back', 'invoicing'); ?></a> |
|
144 | 144 | </span> |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='form-group'> |
15 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The gateway select text', 'invoicing' ); ?></label> |
|
15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The gateway select text', 'invoicing'); ?></label> |
|
16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
17 | 17 | </div> |
@@ -7,12 +7,12 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='form-group'> |
15 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'Enter your text', 'invoicing' ); ?></label> |
|
15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('Enter your text', 'invoicing'); ?></label> |
|
16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
17 | - <small class="form-text text-muted"><?php _e( 'HTML is allowed', 'invoicing' ); ?></small> |
|
17 | + <small class="form-text text-muted"><?php _e('HTML is allowed', 'invoicing'); ?></small> |
|
18 | 18 | </div> |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | ?> |
13 | 13 | |
14 | 14 | <div class='form-group'> |
15 | - <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The total payable text', 'invoicing' ); ?></label> |
|
15 | + <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The total payable text', 'invoicing'); ?></label> |
|
16 | 16 | <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea> |
17 | 17 | </div> |