@@ -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 selectable items. |
13 | 13 | $selectable = array(); |
14 | -foreach ( $form->get_items() as $item ) { |
|
15 | - if ( ! $item->is_required ) { |
|
16 | - $selectable[ $item->get_id() ] = strip_tags( $item->get_name() . ' — ' . wpinv_price( $item->get_initial_price() ) ); |
|
14 | +foreach ($form->get_items() as $item) { |
|
15 | + if (!$item->is_required) { |
|
16 | + $selectable[$item->get_id()] = strip_tags($item->get_name() . ' — ' . wpinv_price($item->get_initial_price())); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if ( empty( $selectable ) ) { |
|
20 | +if (empty($selectable)) { |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | echo aui()->select( |
28 | 28 | array( |
29 | 29 | 'name' => 'getpaid-payment-form-selected-item', |
30 | - 'id' => 'getpaid-payment-form-selected-item' . uniqid( '_' ), |
|
30 | + 'id' => 'getpaid-payment-form-selected-item' . uniqid('_'), |
|
31 | 31 | 'required' => true, |
32 | - 'label' => __( 'Select Item', 'invoicing' ), |
|
32 | + 'label' => __('Select Item', 'invoicing'), |
|
33 | 33 | 'label_type' => 'vertical', |
34 | 34 | 'inline' => false, |
35 | 35 | 'options' => $selectable, |
@@ -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 selectable items. |
13 | 13 | $selectable = array(); |
14 | -foreach ( $form->get_items() as $item ) { |
|
15 | - if ( ! $item->is_required ) { |
|
16 | - $selectable[ $item->get_id() ] = $item->get_name() . ' — ' . wpinv_price( $item->get_initial_price() ); |
|
14 | +foreach ($form->get_items() as $item) { |
|
15 | + if (!$item->is_required) { |
|
16 | + $selectable[$item->get_id()] = $item->get_name() . ' — ' . wpinv_price($item->get_initial_price()); |
|
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if ( empty( $selectable ) ) { |
|
20 | +if (empty($selectable)) { |
|
21 | 21 | return; |
22 | 22 | } |
23 | 23 | |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | echo aui()->radio( |
28 | 28 | array( |
29 | 29 | 'name' => 'getpaid-payment-form-selected-item', |
30 | - 'id' => 'getpaid-payment-form-selected-item' . uniqid( '_' ), |
|
30 | + 'id' => 'getpaid-payment-form-selected-item' . uniqid('_'), |
|
31 | 31 | 'required' => true, |
32 | - 'label' => __( 'Select Item', 'invoicing' ), |
|
32 | + 'label' => __('Select Item', 'invoicing'), |
|
33 | 33 | 'label_type' => 'vertical', |
34 | 34 | 'class' => 'w-auto', |
35 | 35 | 'inline' => false, |
@@ -1,32 +1,32 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | - // Is the request set up correctly? |
|
4 | - if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
5 | - return aui()->alert( |
|
6 | - array( |
|
3 | + // Is the request set up correctly? |
|
4 | + if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
5 | + return aui()->alert( |
|
6 | + array( |
|
7 | 7 | 'type' => 'warning', |
8 | 8 | 'content' => __( 'No payment form or item selected', 'invoicing' ), |
9 | - ) |
|
9 | + ) |
|
10 | 10 | ); |
11 | 11 | wp_die( __( 'No payment form or item selected', 'invoicing' ), 400 ); |
12 | - } |
|
12 | + } |
|
13 | 13 | |
14 | - // Payment form or button? |
|
15 | - if ( ! empty( $_GET['form'] ) ) { |
|
14 | + // Payment form or button? |
|
15 | + if ( ! empty( $_GET['form'] ) ) { |
|
16 | 16 | |
17 | - $shortcode = sprintf( |
|
18 | - '[getpaid form=%s]', |
|
19 | - (int) $_GET['form'] |
|
17 | + $shortcode = sprintf( |
|
18 | + '[getpaid form=%s]', |
|
19 | + (int) $_GET['form'] |
|
20 | 20 | ); |
21 | 21 | |
22 | - } else { |
|
22 | + } else { |
|
23 | 23 | |
24 | - $shortcode = sprintf( |
|
25 | - '[getpaid item=%s]', |
|
26 | - esc_attr( urldecode( $_GET['item'] ) ) |
|
27 | - ); |
|
24 | + $shortcode = sprintf( |
|
25 | + '[getpaid item=%s]', |
|
26 | + esc_attr( urldecode( $_GET['item'] ) ) |
|
27 | + ); |
|
28 | 28 | |
29 | - } |
|
29 | + } |
|
30 | 30 | |
31 | 31 | ?> |
32 | 32 | |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | |
45 | 45 | <title>GetPaid</title> |
46 | 46 | <?php |
47 | - wp_enqueue_scripts(); |
|
48 | - wp_print_styles(); |
|
49 | - wp_print_head_scripts(); |
|
50 | - wp_custom_css_cb(); |
|
51 | - wpinv_get_template( 'frontend-head.php' ); |
|
52 | - ?> |
|
47 | + wp_enqueue_scripts(); |
|
48 | + wp_print_styles(); |
|
49 | + wp_print_head_scripts(); |
|
50 | + wp_custom_css_cb(); |
|
51 | + wpinv_get_template( 'frontend-head.php' ); |
|
52 | + ?> |
|
53 | 53 | |
54 | 54 | <style type="text/css"> |
55 | 55 | .body{ |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | <body class="body page-template-default page"> |
84 | 84 | <div id="getpaid-form-embed" class="container my-5 page type-page status-publish hentry post post-content"> |
85 | 85 | <?php |
86 | - do_action( 'getpaid_payment_form_embed_top' ); |
|
87 | - echo do_shortcode( $shortcode ); |
|
88 | - do_action( 'getpaid_payment_form_embed_bottom' ); |
|
89 | - wpinv_get_template( 'frontend-footer.php' ); |
|
90 | - ?> |
|
86 | + do_action( 'getpaid_payment_form_embed_top' ); |
|
87 | + echo do_shortcode( $shortcode ); |
|
88 | + do_action( 'getpaid_payment_form_embed_bottom' ); |
|
89 | + wpinv_get_template( 'frontend-footer.php' ); |
|
90 | + ?> |
|
91 | 91 | </div> |
92 | 92 | <?php wp_footer(); ?> |
93 | 93 | </body> |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Is the request set up correctly? |
4 | - if ( empty( $_GET['form'] ) && empty( $_GET['item'] ) ) { |
|
4 | + if (empty($_GET['form']) && empty($_GET['item'])) { |
|
5 | 5 | return aui()->alert( |
6 | 6 | array( |
7 | 7 | 'type' => 'warning', |
8 | - 'content' => __( 'No payment form or item selected', 'invoicing' ), |
|
8 | + 'content' => __('No payment form or item selected', 'invoicing'), |
|
9 | 9 | ) |
10 | 10 | ); |
11 | -wp_die( __( 'No payment form or item selected', 'invoicing' ), 400 ); |
|
11 | +wp_die(__('No payment form or item selected', 'invoicing'), 400); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // Payment form or button? |
15 | - if ( ! empty( $_GET['form'] ) ) { |
|
15 | + if (!empty($_GET['form'])) { |
|
16 | 16 | |
17 | 17 | $shortcode = sprintf( |
18 | 18 | '[getpaid form=%s]', |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $shortcode = sprintf( |
25 | 25 | '[getpaid item=%s]', |
26 | - esc_attr( urldecode( $_GET['item'] ) ) |
|
26 | + esc_attr(urldecode($_GET['item'])) |
|
27 | 27 | ); |
28 | 28 | |
29 | 29 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | <head> |
37 | 37 | |
38 | - <meta charset="<?php bloginfo( 'charset' ); ?>"> |
|
38 | + <meta charset="<?php bloginfo('charset'); ?>"> |
|
39 | 39 | <meta name="viewport" content="width=device-width, initial-scale=1.0" > |
40 | 40 | |
41 | 41 | <meta name="robots" content="noindex,nofollow"> |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | wp_print_styles(); |
49 | 49 | wp_print_head_scripts(); |
50 | 50 | wp_custom_css_cb(); |
51 | - wpinv_get_template( 'frontend-head.php' ); |
|
51 | + wpinv_get_template('frontend-head.php'); |
|
52 | 52 | ?> |
53 | 53 | |
54 | 54 | <style type="text/css"> |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | <body class="body page-template-default page"> |
84 | 84 | <div id="getpaid-form-embed" class="container my-5 page type-page status-publish hentry post post-content"> |
85 | 85 | <?php |
86 | - do_action( 'getpaid_payment_form_embed_top' ); |
|
87 | - echo do_shortcode( $shortcode ); |
|
88 | - do_action( 'getpaid_payment_form_embed_bottom' ); |
|
89 | - wpinv_get_template( 'frontend-footer.php' ); |
|
86 | + do_action('getpaid_payment_form_embed_top'); |
|
87 | + echo do_shortcode($shortcode); |
|
88 | + do_action('getpaid_payment_form_embed_bottom'); |
|
89 | + wpinv_get_template('frontend-footer.php'); |
|
90 | 90 | ?> |
91 | 91 | </div> |
92 | 92 | <?php wp_footer(); ?> |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | // And the optional invoice id. |
48 | 48 | if ( ! empty( $form->invoice ) ) { |
49 | - echo getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
49 | + echo getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // We also want to include the form id. |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | |
67 | 67 | foreach ( $form->get_elements() as $element ) { |
68 | 68 | |
69 | - if ( isset( $element['type'] ) ) { |
|
70 | - $grid_class = esc_attr( getpaid_get_form_element_grid_class( $element ) ); |
|
71 | - echo "<div class='$grid_class'>"; |
|
72 | - do_action( 'getpaid_payment_form_element', $element, $form ); |
|
73 | - do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
74 | - echo '</div>'; |
|
69 | + if ( isset( $element['type'] ) ) { |
|
70 | + $grid_class = esc_attr( getpaid_get_form_element_grid_class( $element ) ); |
|
71 | + echo "<div class='$grid_class'>"; |
|
72 | + do_action( 'getpaid_payment_form_element', $element, $form ); |
|
73 | + do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
74 | + echo '</div>'; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 |
@@ -7,26 +7,26 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Make sure that the form is active. |
13 | -if ( ! $form->is_active() ) { |
|
13 | +if (!$form->is_active()) { |
|
14 | 14 | echo aui()->alert( |
15 | 15 | array( |
16 | 16 | 'type' => 'warning', |
17 | - 'content' => __( 'This payment form is no longer active', 'invoicing' ), |
|
17 | + 'content' => __('This payment form is no longer active', 'invoicing'), |
|
18 | 18 | ) |
19 | 19 | ); |
20 | 20 | return; |
21 | 21 | } |
22 | 22 | |
23 | 23 | // Require login to checkout. |
24 | -if ( wpinv_require_login_to_checkout() && ! get_current_user_id() ) { |
|
24 | +if (wpinv_require_login_to_checkout() && !get_current_user_id()) { |
|
25 | 25 | |
26 | 26 | echo aui()->alert( |
27 | 27 | array( |
28 | 28 | 'type' => 'danger', |
29 | - 'content' => __( 'You must be logged in to checkout.', 'invoicing' ), |
|
29 | + 'content' => __('You must be logged in to checkout.', 'invoicing'), |
|
30 | 30 | ) |
31 | 31 | ); |
32 | 32 | return; |
@@ -34,29 +34,29 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | // Fires before displaying a payment form. |
37 | -do_action( 'getpaid_before_payment_form', $form ); |
|
37 | +do_action('getpaid_before_payment_form', $form); |
|
38 | 38 | ?> |
39 | 39 | |
40 | -<form class='getpaid-payment-form getpaid-payment-form-<?php echo absint( $form->get_id() ); ?> bsui position-relative' method='POST' data-key='<?php echo uniqid( 'gpf' ); ?>' data-currency='<?php echo esc_attr( empty( $form->invoice ) ? wpinv_get_currency() : $form->invoice->get_currency() ); ?>' novalidate> |
|
40 | +<form class='getpaid-payment-form getpaid-payment-form-<?php echo absint($form->get_id()); ?> bsui position-relative' method='POST' data-key='<?php echo uniqid('gpf'); ?>' data-currency='<?php echo esc_attr(empty($form->invoice) ? wpinv_get_currency() : $form->invoice->get_currency()); ?>' novalidate> |
|
41 | 41 | |
42 | 42 | <?php |
43 | 43 | |
44 | 44 | // Fires when printing the top of a payment form. |
45 | - do_action( 'getpaid_payment_form_top', $form ); |
|
45 | + do_action('getpaid_payment_form_top', $form); |
|
46 | 46 | |
47 | 47 | // And the optional invoice id. |
48 | - if ( ! empty( $form->invoice ) ) { |
|
49 | - echo getpaid_hidden_field( 'invoice_id', $form->invoice->get_id() ); |
|
48 | + if (!empty($form->invoice)) { |
|
49 | + echo getpaid_hidden_field('invoice_id', $form->invoice->get_id()); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | // We also want to include the form id. |
53 | - echo getpaid_hidden_field( 'form_id', $form->get_id() ); |
|
53 | + echo getpaid_hidden_field('form_id', $form->get_id()); |
|
54 | 54 | |
55 | 55 | // And an indication that this is a payment form submission. |
56 | - echo getpaid_hidden_field( 'getpaid_payment_form_submission', '1' ); |
|
56 | + echo getpaid_hidden_field('getpaid_payment_form_submission', '1'); |
|
57 | 57 | |
58 | 58 | // Fires before displaying payment form elements. |
59 | - do_action( 'getpaid_payment_form_before_elements', $form ); |
|
59 | + do_action('getpaid_payment_form_before_elements', $form); |
|
60 | 60 | |
61 | 61 | // Display the elements. |
62 | 62 | ?> |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | <div class="row"> |
65 | 65 | <?php |
66 | 66 | |
67 | - foreach ( $form->get_elements() as $element ) { |
|
67 | + foreach ($form->get_elements() as $element) { |
|
68 | 68 | |
69 | - if ( isset( $element['type'] ) ) { |
|
70 | - $grid_class = esc_attr( getpaid_get_form_element_grid_class( $element ) ); |
|
69 | + if (isset($element['type'])) { |
|
70 | + $grid_class = esc_attr(getpaid_get_form_element_grid_class($element)); |
|
71 | 71 | echo "<div class='$grid_class'>"; |
72 | - do_action( 'getpaid_payment_form_element', $element, $form ); |
|
73 | - do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
72 | + do_action('getpaid_payment_form_element', $element, $form); |
|
73 | + do_action("getpaid_payment_form_element_{$element['type']}_template", $element, $form); |
|
74 | 74 | echo '</div>'; |
75 | 75 | } |
76 | 76 | } |
@@ -81,28 +81,28 @@ discard block |
||
81 | 81 | |
82 | 82 | <?php |
83 | 83 | // Fires after displaying payment form elements. |
84 | - do_action( 'getpaid_payment_form_after_elements', $form ); |
|
84 | + do_action('getpaid_payment_form_after_elements', $form); |
|
85 | 85 | |
86 | 86 | echo "<div class='getpaid-payment-form-errors alert alert-danger d-none'></div>"; |
87 | 87 | |
88 | - if ( wpinv_current_user_can_manage_invoicing() ) { |
|
88 | + if (wpinv_current_user_can_manage_invoicing()) { |
|
89 | 89 | |
90 | 90 | edit_post_link( |
91 | - __( 'Edit this form.', 'invoicing' ), |
|
91 | + __('Edit this form.', 'invoicing'), |
|
92 | 92 | '<small class="form-text text-muted">', |
93 | - ' ' . __( 'This is only visible to website administators.', 'invoicing' ) . '</small>', |
|
93 | + ' ' . __('This is only visible to website administators.', 'invoicing') . '</small>', |
|
94 | 94 | $form->get_id(), |
95 | 95 | 'text-danger' |
96 | 96 | ); |
97 | 97 | |
98 | 98 | } |
99 | 99 | |
100 | - echo wp_kses_post( $extra_markup ); |
|
100 | + echo wp_kses_post($extra_markup); |
|
101 | 101 | ?> |
102 | 102 | |
103 | 103 | <div class="loading_div overlay overlay-black position-absolute row m-0 rounded overflow-hidden" style="height: 100%;width: 100%;top: 0px;z-index: 2;display:none;"> |
104 | 104 | <div class="spinner-border mx-auto align-self-center text-white" role="status"> |
105 | - <span class="sr-only"><?php _e( 'Loading...', 'invoicing' ); ?></span> |
|
105 | + <span class="sr-only"><?php _e('Loading...', 'invoicing'); ?></span> |
|
106 | 106 | </div> |
107 | 107 | </div> |
108 | 108 | |
@@ -111,4 +111,4 @@ discard block |
||
111 | 111 | <?php |
112 | 112 | |
113 | 113 | // Fires after displaying a payment form. |
114 | -do_action( 'getpaid_after_payment_form', $form ); |
|
114 | +do_action('getpaid_after_payment_form', $form); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | 46 | foreach ( $form->get_items() as $item ) { |
47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
47 | + wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the cart totals. |
@@ -7,34 +7,34 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Cart table columns. |
13 | 13 | $columns = array( |
14 | - 'name' => __( 'Item', 'invoicing' ), |
|
15 | - 'price' => __( 'Price', 'invoicing' ), |
|
16 | - 'quantity' => __( 'Qty', 'invoicing' ), |
|
17 | - 'subtotal' => __( 'Subtotal', 'invoicing' ), |
|
14 | + 'name' => __('Item', 'invoicing'), |
|
15 | + 'price' => __('Price', 'invoicing'), |
|
16 | + 'quantity' => __('Qty', 'invoicing'), |
|
17 | + 'subtotal' => __('Subtotal', 'invoicing'), |
|
18 | 18 | ); |
19 | 19 | |
20 | -if ( ! empty( $form->invoice ) ) { |
|
21 | - $columns = getpaid_invoice_item_columns( $form->invoice ); |
|
20 | +if (!empty($form->invoice)) { |
|
21 | + $columns = getpaid_invoice_item_columns($form->invoice); |
|
22 | 22 | } |
23 | 23 | |
24 | -if ( isset( $columns['tax_rate'] ) ) { |
|
25 | - unset( $columns['tax_rate'] ); |
|
24 | +if (isset($columns['tax_rate'])) { |
|
25 | + unset($columns['tax_rate']); |
|
26 | 26 | } |
27 | 27 | |
28 | -$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form ); |
|
28 | +$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form); |
|
29 | 29 | |
30 | 30 | ?> |
31 | 31 | <div class="getpaid-payment-form-items-cart border form-group"> |
32 | 32 | |
33 | 33 | <div class="getpaid-payment-form-items-cart-header font-weight-bold bg-light border-bottom py-2 px-3"> |
34 | 34 | <div class="form-row"> |
35 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
36 | - <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo ( in_array( $key, array( 'subtotal', 'quantity', 'tax_rate' ) ) ) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo sanitize_html_class( $key ); ?>"> |
|
37 | - <span><?php echo esc_html( $label ); ?></span> |
|
35 | + <?php foreach ($columns as $key => $label) : ?> |
|
36 | + <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo (in_array($key, array('subtotal', 'quantity', 'tax_rate'))) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo sanitize_html_class($key); ?>"> |
|
37 | + <span><?php echo esc_html($label); ?></span> |
|
38 | 38 | </div> |
39 | 39 | <?php endforeach; ?> |
40 | 40 | </div> |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | <?php |
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | - foreach ( $form->get_items() as $item ) { |
|
47 | - wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) ); |
|
46 | + foreach ($form->get_items() as $item) { |
|
47 | + wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns')); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the cart totals. |
51 | - wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) ); |
|
51 | + wpinv_get_template('payment-forms/cart-totals.php', compact('form')); |
|
52 | 52 | |
53 | 53 | ?> |
54 | 54 | </div> |
55 | 55 | |
56 | 56 | <?php |
57 | 57 | |
58 | -do_action( 'getpaid_after_payment_form_cart', $form ); |
|
58 | +do_action('getpaid_after_payment_form_cart', $form); |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | <p> |
4 | 4 | <?php |
5 | 5 | echo wp_sprintf( |
6 | - __( 'Your payment is processing. This page will reload automatically in 10 seconds. If it does not, click <a href="%s">here</a>.', 'invoicing' ), |
|
7 | - esc_url_raw( remove_query_arg( 'payment-confirm' ) ) |
|
6 | + __('Your payment is processing. This page will reload automatically in 10 seconds. If it does not, click <a href="%s">here</a>.', 'invoicing'), |
|
7 | + esc_url_raw(remove_query_arg('payment-confirm')) |
|
8 | 8 | ); |
9 | 9 | ?> |
10 | 10 | <i class="fa fa-spin fa-refresh"></i> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | <script type="text/javascript"> |
14 | 14 | setTimeout( |
15 | 15 | function(){ |
16 | - window.location.href = '<?php echo esc_url_raw( remove_query_arg( 'payment-confirm' ) ); ?>'; |
|
16 | + window.location.href = '<?php echo esc_url_raw(remove_query_arg('payment-confirm')); ?>'; |
|
17 | 17 | }, |
18 | 18 | 10000 |
19 | 19 | ); |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
4 | - die( '-1' ); |
|
3 | +if (!defined('ABSPATH')) { |
|
4 | + die('-1'); |
|
5 | 5 | } |
6 | 6 | |
7 | -$email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) ); |
|
8 | -$email_footer = $email_footer ? wpautop( wp_kses_post( wptexturize( $email_footer ) ) ) : ''; |
|
7 | +$email_footer = apply_filters('wpinv_email_footer_text', wpinv_get_option('email_footer_text', get_bloginfo('name', 'display') . ' - ' . __('Powered by GetPaid', 'invoicing'))); |
|
8 | +$email_footer = $email_footer ? wpautop(wp_kses_post(wptexturize($email_footer))) : ''; |
|
9 | 9 | ?> |
10 | 10 | </div> |
11 | 11 | </td> |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | <table border="0" cellpadding="10" cellspacing="0" width="100%"> |
28 | 28 | <tr> |
29 | 29 | <td colspan="2" valign="middle" id="credit"> |
30 | - <?php echo wp_kses_post( $email_footer ); ?> |
|
30 | + <?php echo wp_kses_post($email_footer); ?> |
|
31 | 31 | </td> |
32 | 32 | </tr> |
33 | 33 | </table> |
@@ -44,12 +44,12 @@ |
||
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | 46 | foreach ( $invoice->get_items() as $item ) { |
47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
47 | + wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the fee totals. |
51 | 51 | foreach ( $invoice->get_fees() as $fee ) { |
52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
52 | + wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | ?> |
@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | * @var WPInv_Invoice $invoice |
9 | 9 | */ |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | -$column_count = count( $columns ); |
|
13 | +$column_count = count($columns); |
|
14 | 14 | ?> |
15 | 15 | |
16 | -<?php do_action( 'wpinv_before_email_items', $invoice ); ?> |
|
16 | +<?php do_action('wpinv_before_email_items', $invoice); ?> |
|
17 | 17 | |
18 | 18 | |
19 | 19 | <div id="wpinv-email-items"> |
20 | 20 | |
21 | 21 | <h3 class="invoice-items-title"> |
22 | - <?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) ); ?> |
|
22 | + <?php echo sprintf(esc_html__('%s Items', 'invoicing'), esc_html(ucfirst($invoice->get_invoice_quote_type()))); ?> |
|
23 | 23 | </h3> |
24 | 24 | |
25 | 25 | <table class="table table-bordered table-hover"> |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | <tr class="wpinv_cart_header_row"> |
30 | 30 | |
31 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
32 | - <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo sanitize_html_class( $key ); ?>"> |
|
33 | - <?php echo esc_html( $label ); ?> |
|
31 | + <?php foreach ($columns as $key => $label) : ?> |
|
32 | + <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right'; ?> wpinv_cart_item_<?php echo sanitize_html_class($key); ?>"> |
|
33 | + <?php echo esc_html($label); ?> |
|
34 | 34 | </th> |
35 | 35 | <?php endforeach; ?> |
36 | 36 | |
@@ -43,13 +43,13 @@ discard block |
||
43 | 43 | <?php |
44 | 44 | |
45 | 45 | // Display the item totals. |
46 | - foreach ( $invoice->get_items() as $item ) { |
|
47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
46 | + foreach ($invoice->get_items() as $item) { |
|
47 | + wpinv_get_template('emails/invoice-item.php', compact('invoice', 'item', 'columns')); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | // Display the fee totals. |
51 | - foreach ( $invoice->get_fees() as $fee ) { |
|
52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
51 | + foreach ($invoice->get_fees() as $fee) { |
|
52 | + wpinv_get_template('emails/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | ?> |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | </tbody> |
58 | 58 | |
59 | 59 | <tfoot> |
60 | - <?php wpinv_get_template( 'emails/invoice-totals.php', compact( 'invoice', 'column_count' ) ); ?> |
|
60 | + <?php wpinv_get_template('emails/invoice-totals.php', compact('invoice', 'column_count')); ?> |
|
61 | 61 | </tfoot> |
62 | 62 | |
63 | 63 | </table> |
@@ -20,7 +20,7 @@ |
||
20 | 20 | <a href="<?php echo esc_url( add_query_arg( 'user_id', $invoice->get_user_id(), self_admin_url( 'user-edit.php' ) ) ); ?>"><?php echo esc_html( $invoice->get_user_full_name() ); ?></a> |
21 | 21 | <?php |
22 | 22 | } else { |
23 | - echo esc_html( $invoice->get_user_full_name() ); } |
|
23 | + echo esc_html( $invoice->get_user_full_name() ); } |
|
24 | 24 | ?> |
25 | 25 | </td> |
26 | 26 | </tr> |
@@ -1,51 +1,51 @@ |
||
1 | 1 | <?php |
2 | 2 | // don't load directly |
3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
4 | - die( '-1' ); |
|
3 | +if (!defined('ABSPATH')) { |
|
4 | + die('-1'); |
|
5 | 5 | } |
6 | 6 | |
7 | -do_action( 'wpinv_email_before_billing_details', $invoice ); ?> |
|
7 | +do_action('wpinv_email_before_billing_details', $invoice); ?> |
|
8 | 8 | <div id="wpinv-email-billing"> |
9 | - <h3 class="wpinv-address-t"><?php echo apply_filters( 'wpinv_email_billing_title', __( 'Billing Details', 'invoicing' ) ); ?></h3> |
|
9 | + <h3 class="wpinv-address-t"><?php echo apply_filters('wpinv_email_billing_title', __('Billing Details', 'invoicing')); ?></h3> |
|
10 | 10 | |
11 | 11 | <table class="table table-bordered table-sm wpi-billing-details"> |
12 | 12 | <tbody> |
13 | - <?php do_action( 'wpinv_email_billing_fields_first', $invoice ); ?> |
|
13 | + <?php do_action('wpinv_email_billing_fields_first', $invoice); ?> |
|
14 | 14 | <tr class="wpi-receipt-name"> |
15 | - <th class="text-left"><?php _e( 'Name', 'invoicing' ); ?></th> |
|
15 | + <th class="text-left"><?php _e('Name', 'invoicing'); ?></th> |
|
16 | 16 | <td> |
17 | 17 | <?php |
18 | - if ( $sent_to_admin && $invoice->get_user_id() ) { |
|
18 | + if ($sent_to_admin && $invoice->get_user_id()) { |
|
19 | 19 | ?> |
20 | -<a href="<?php echo esc_url( add_query_arg( 'user_id', $invoice->get_user_id(), self_admin_url( 'user-edit.php' ) ) ); ?>"><?php echo esc_html( $invoice->get_user_full_name() ); ?></a> |
|
20 | +<a href="<?php echo esc_url(add_query_arg('user_id', $invoice->get_user_id(), self_admin_url('user-edit.php'))); ?>"><?php echo esc_html($invoice->get_user_full_name()); ?></a> |
|
21 | 21 | <?php |
22 | 22 | } else { |
23 | - echo esc_html( $invoice->get_user_full_name() ); } |
|
23 | + echo esc_html($invoice->get_user_full_name()); } |
|
24 | 24 | ?> |
25 | 25 | </td> |
26 | 26 | </tr> |
27 | 27 | <tr class="wpi-receipt-email"> |
28 | - <th class="text-left"><?php _e( 'Email', 'invoicing' ); ?></th> |
|
29 | - <td><?php echo sanitize_email( $invoice->get_email() ); ?></td> |
|
28 | + <th class="text-left"><?php _e('Email', 'invoicing'); ?></th> |
|
29 | + <td><?php echo sanitize_email($invoice->get_email()); ?></td> |
|
30 | 30 | </tr> |
31 | - <?php if ( $invoice->get_company() ) { ?> |
|
31 | + <?php if ($invoice->get_company()) { ?> |
|
32 | 32 | <tr class="wpi-receipt-company"> |
33 | - <th class="text-left"><?php _e( 'Company', 'invoicing' ); ?></th> |
|
34 | - <td><?php echo esc_html( $invoice->get_company() ); ?></td> |
|
33 | + <th class="text-left"><?php _e('Company', 'invoicing'); ?></th> |
|
34 | + <td><?php echo esc_html($invoice->get_company()); ?></td> |
|
35 | 35 | </tr> |
36 | 36 | <?php } ?> |
37 | 37 | <tr class="wpi-receipt-address"> |
38 | - <th class="text-left"><?php _e( 'Address', 'invoicing' ); ?></th> |
|
39 | - <td><?php echo wp_kses_post( wpinv_get_invoice_address_markup( $invoice->get_user_info() ) ); ?></td> |
|
38 | + <th class="text-left"><?php _e('Address', 'invoicing'); ?></th> |
|
39 | + <td><?php echo wp_kses_post(wpinv_get_invoice_address_markup($invoice->get_user_info())); ?></td> |
|
40 | 40 | </tr> |
41 | - <?php if ( $invoice->get_phone() ) { ?> |
|
41 | + <?php if ($invoice->get_phone()) { ?> |
|
42 | 42 | <tr class="wpi-receipt-phone"> |
43 | - <th class="text-left"><?php _e( 'Phone', 'invoicing' ); ?></th> |
|
44 | - <td><?php echo esc_html( $invoice->get_phone() ); ?></td> |
|
43 | + <th class="text-left"><?php _e('Phone', 'invoicing'); ?></th> |
|
44 | + <td><?php echo esc_html($invoice->get_phone()); ?></td> |
|
45 | 45 | </tr> |
46 | 46 | <?php } ?> |
47 | - <?php do_action( 'wpinv_email_billing_fields_last', $invoice ); ?> |
|
47 | + <?php do_action('wpinv_email_billing_fields_last', $invoice); ?> |
|
48 | 48 | </tbody> |
49 | 49 | </table> |
50 | 50 | </div> |
51 | -<?php do_action( 'wpinv_email_after_billing_details', $invoice ); ?> |
|
51 | +<?php do_action('wpinv_email_after_billing_details', $invoice); ?> |