@@ -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 | echo aui()->alert( |
13 | 13 | array( |
14 | - 'content' => esc_html__( 'The total payable amount will appear here', 'invoicing' ), |
|
14 | + 'content' => esc_html__('The total payable amount will appear here', 'invoicing'), |
|
15 | 15 | 'type' => 'info', |
16 | 16 | ) |
17 | 17 | ); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | |
11 | -defined( 'ABSPATH' ) || exit; |
|
11 | +defined('ABSPATH') || exit; |
|
12 | 12 | |
13 | 13 | ?> |
14 | 14 | <component :is='form_element.level' v-html='form_element.text'></component> |
@@ -7,16 +7,16 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Set the currency position. |
13 | 13 | $position = wpinv_currency_position(); |
14 | 14 | |
15 | -if ( $position == 'left_space' ) { |
|
15 | +if ($position == 'left_space') { |
|
16 | 16 | $position = 'left'; |
17 | 17 | } |
18 | 18 | |
19 | -if ( $position == 'right_space' ) { |
|
19 | +if ($position == 'right_space') { |
|
20 | 20 | $position = 'right'; |
21 | 21 | } |
22 | 22 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | <div class="input-group"> |
28 | 28 | |
29 | - <?php if ( $position == 'left' ) : ?> |
|
29 | + <?php if ($position == 'left') : ?> |
|
30 | 30 | <div class="input-group-prepend"> |
31 | 31 | <span class="input-group-text"><?php echo wpinv_currency_symbol(); ?></span> |
32 | 32 | </div> |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | <input :placeholder='form_element.placeholder' class='form-control' type='text'> |
36 | 36 | |
37 | - <?php if ( $position == 'right' ) : ?> |
|
37 | + <?php if ($position == 'right') : ?> |
|
38 | 38 | <div class="input-group-append"> |
39 | 39 | <span class="input-group-text"><?php echo wpinv_currency_symbol(); ?></span> |
40 | 40 | </div> |
@@ -7,14 +7,14 @@ |
||
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 v-if='!is_default'> |
15 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here. Click to set items.', 'invoicing' ); ?></div> |
|
15 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here. Click to set items.', 'invoicing'); ?></div> |
|
16 | 16 | </div> |
17 | 17 | |
18 | 18 | <div v-if='is_default'> |
19 | - <div class='alert alert-info' role='alert'><?php _e( 'Item totals will appear here.', 'invoicing' ); ?></div> |
|
19 | + <div class='alert alert-info' role='alert'><?php _e('Item totals will appear here.', 'invoicing'); ?></div> |
|
20 | 20 | </div> |
@@ -42,92 +42,92 @@ discard block |
||
42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class( $invoice->get_status() ); ?>"> |
43 | 43 | <?php |
44 | 44 | |
45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
45 | + foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
46 | 46 | |
47 | - $column_id = sanitize_html_class( $column_id ); |
|
48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
47 | + $column_id = sanitize_html_class( $column_id ); |
|
48 | + $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
49 | 49 | |
50 | - echo "<td class='$column_id $class'>"; |
|
51 | - switch ( $column_id ) { |
|
50 | + echo "<td class='$column_id $class'>"; |
|
51 | + switch ( $column_id ) { |
|
52 | 52 | |
53 | - case 'invoice-number': |
|
54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
55 | - break; |
|
53 | + case 'invoice-number': |
|
54 | + echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
55 | + break; |
|
56 | 56 | |
57 | - case 'created-date': |
|
58 | - echo getpaid_format_date_value( $invoice->get_date_created() ); |
|
59 | - break; |
|
57 | + case 'created-date': |
|
58 | + echo getpaid_format_date_value( $invoice->get_date_created() ); |
|
59 | + break; |
|
60 | 60 | |
61 | - case 'payment-date': |
|
62 | - if ( $invoice->needs_payment() ) { |
|
63 | - echo '—'; |
|
64 | - } else { |
|
65 | - echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
66 | - } |
|
61 | + case 'payment-date': |
|
62 | + if ( $invoice->needs_payment() ) { |
|
63 | + echo '—'; |
|
64 | + } else { |
|
65 | + echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
66 | + } |
|
67 | 67 | |
68 | - break; |
|
68 | + break; |
|
69 | 69 | |
70 | - case 'invoice-status': |
|
71 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
70 | + case 'invoice-status': |
|
71 | + echo wp_kses_post( $invoice->get_status_label_html() ); |
|
72 | 72 | |
73 | - break; |
|
73 | + break; |
|
74 | 74 | |
75 | - case 'invoice-total': |
|
76 | - echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
75 | + case 'invoice-total': |
|
76 | + echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
77 | 77 | |
78 | - break; |
|
78 | + break; |
|
79 | 79 | |
80 | - case 'invoice-actions': |
|
81 | - $actions = array( |
|
80 | + case 'invoice-actions': |
|
81 | + $actions = array( |
|
82 | 82 | |
83 | - 'pay' => array( |
|
84 | - 'url' => $invoice->get_checkout_payment_url(), |
|
85 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
86 | - 'class' => 'btn-success', |
|
87 | - ), |
|
83 | + 'pay' => array( |
|
84 | + 'url' => $invoice->get_checkout_payment_url(), |
|
85 | + 'name' => __( 'Pay Now', 'invoicing' ), |
|
86 | + 'class' => 'btn-success', |
|
87 | + ), |
|
88 | 88 | |
89 | - 'print' => array( |
|
90 | - 'url' => $invoice->get_view_url(), |
|
91 | - 'name' => __( 'View', 'invoicing' ), |
|
92 | - 'class' => 'btn-secondary', |
|
93 | - 'attrs' => 'target="_blank"', |
|
94 | - ), |
|
95 | - ); |
|
89 | + 'print' => array( |
|
90 | + 'url' => $invoice->get_view_url(), |
|
91 | + 'name' => __( 'View', 'invoicing' ), |
|
92 | + 'class' => 'btn-secondary', |
|
93 | + 'attrs' => 'target="_blank"', |
|
94 | + ), |
|
95 | + ); |
|
96 | 96 | |
97 | - if ( ! $invoice->needs_payment() ) { |
|
98 | - unset( $actions['pay'] ); |
|
99 | - } |
|
97 | + if ( ! $invoice->needs_payment() ) { |
|
98 | + unset( $actions['pay'] ); |
|
99 | + } |
|
100 | 100 | |
101 | - if ( $invoice->needs_payment() ) { |
|
102 | - $actions['delete'] = array( |
|
103 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | - 'name' => __( 'Delete', 'invoicing' ), |
|
105 | - 'class' => 'btn-danger', |
|
106 | - ); |
|
107 | - } |
|
101 | + if ( $invoice->needs_payment() ) { |
|
102 | + $actions['delete'] = array( |
|
103 | + 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | + 'name' => __( 'Delete', 'invoicing' ), |
|
105 | + 'class' => 'btn-danger', |
|
106 | + ); |
|
107 | + } |
|
108 | 108 | |
109 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
109 | + $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
110 | 110 | |
111 | - foreach ( $actions as $key => $action ) { |
|
112 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . $class . ' ' . sanitize_html_class( $key ) . '" ' . ( ! empty( $action['attrs'] ) ? $action['attrs'] : '' ) . '>' . $action['name'] . '</a>'; |
|
114 | - } |
|
111 | + foreach ( $actions as $key => $action ) { |
|
112 | + $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | + echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . $class . ' ' . sanitize_html_class( $key ) . '" ' . ( ! empty( $action['attrs'] ) ? $action['attrs'] : '' ) . '>' . $action['name'] . '</a>'; |
|
114 | + } |
|
115 | 115 | |
116 | - break; |
|
116 | + break; |
|
117 | 117 | |
118 | - default: |
|
119 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
120 | - break; |
|
118 | + default: |
|
119 | + do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
120 | + break; |
|
121 | 121 | |
122 | 122 | |
123 | - } |
|
123 | + } |
|
124 | 124 | |
125 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
125 | + do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
126 | 126 | |
127 | - echo '</td>'; |
|
127 | + echo '</td>'; |
|
128 | 128 | |
129 | - endforeach; |
|
130 | - ?> |
|
129 | + endforeach; |
|
130 | + ?> |
|
131 | 131 | </tr> |
132 | 132 | |
133 | 133 | <?php endforeach; ?> |
@@ -141,16 +141,16 @@ discard block |
||
141 | 141 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
142 | 142 | <div class="invoicing-Pagination"> |
143 | 143 | <?php |
144 | - $big = 999999; |
|
144 | + $big = 999999; |
|
145 | 145 | |
146 | - echo paginate_links( |
|
146 | + echo paginate_links( |
|
147 | 147 | array( |
148 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
149 | - 'format' => '?paged=%#%', |
|
150 | - 'total' => $invoices->max_num_pages, |
|
148 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
149 | + 'format' => '?paged=%#%', |
|
150 | + 'total' => $invoices->max_num_pages, |
|
151 | 151 | ) |
152 | 152 | ); |
153 | - ?> |
|
153 | + ?> |
|
154 | 154 | </div> |
155 | 155 | <?php endif; ?> |
156 | 156 |
@@ -7,27 +7,27 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Current page. |
13 | -$current_page = empty( $_GET['page'] ) ? 1 : absint( $_GET['page'] ); |
|
13 | +$current_page = empty($_GET['page']) ? 1 : absint($_GET['page']); |
|
14 | 14 | |
15 | 15 | // Fires before displaying user invoices. |
16 | -do_action( 'wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); |
|
16 | +do_action('wpinv_before_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); |
|
17 | 17 | |
18 | 18 | ?> |
19 | 19 | |
20 | 20 | |
21 | 21 | <div class="table-responsive"> |
22 | - <table class="table table-bordered table-hover getpaid-user-invoices <?php echo sanitize_html_class( $post_type ); ?>"> |
|
22 | + <table class="table table-bordered table-hover getpaid-user-invoices <?php echo sanitize_html_class($post_type); ?>"> |
|
23 | 23 | |
24 | 24 | |
25 | 25 | <thead> |
26 | 26 | <tr> |
27 | 27 | |
28 | - <?php foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : ?> |
|
29 | - <th class="<?php echo sanitize_html_class( $column_id ); ?> <?php echo ( ! empty( $column_name['class'] ) ? sanitize_html_class( $column_name['class'] ) : ''); ?> border-bottom-0"> |
|
30 | - <span class="nobr"><?php echo esc_html( $column_name['title'] ); ?></span> |
|
28 | + <?php foreach (wpinv_get_user_invoices_columns($post_type) as $column_id => $column_name) : ?> |
|
29 | + <th class="<?php echo sanitize_html_class($column_id); ?> <?php echo (!empty($column_name['class']) ? sanitize_html_class($column_name['class']) : ''); ?> border-bottom-0"> |
|
30 | + <span class="nobr"><?php echo esc_html($column_name['title']); ?></span> |
|
31 | 31 | </th> |
32 | 32 | <?php endforeach; ?> |
33 | 33 | |
@@ -37,43 +37,43 @@ discard block |
||
37 | 37 | |
38 | 38 | |
39 | 39 | <tbody> |
40 | - <?php foreach ( $invoices->invoices as $invoice ) : ?> |
|
40 | + <?php foreach ($invoices->invoices as $invoice) : ?> |
|
41 | 41 | |
42 | - <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class( $invoice->get_status() ); ?>"> |
|
42 | + <tr class="wpinv-item wpinv-item-<?php echo sanitize_html_class($invoice->get_status()); ?>"> |
|
43 | 43 | <?php |
44 | 44 | |
45 | - foreach ( wpinv_get_user_invoices_columns( $post_type ) as $column_id => $column_name ) : |
|
45 | + foreach (wpinv_get_user_invoices_columns($post_type) as $column_id => $column_name) : |
|
46 | 46 | |
47 | - $column_id = sanitize_html_class( $column_id ); |
|
48 | - $class = empty( $column_name['class'] ) ? '' : sanitize_html_class( $column_name['class'] ); |
|
47 | + $column_id = sanitize_html_class($column_id); |
|
48 | + $class = empty($column_name['class']) ? '' : sanitize_html_class($column_name['class']); |
|
49 | 49 | |
50 | 50 | echo "<td class='$column_id $class'>"; |
51 | - switch ( $column_id ) { |
|
51 | + switch ($column_id) { |
|
52 | 52 | |
53 | 53 | case 'invoice-number': |
54 | - echo wp_kses_post( wpinv_invoice_link( $invoice ) ); |
|
54 | + echo wp_kses_post(wpinv_invoice_link($invoice)); |
|
55 | 55 | break; |
56 | 56 | |
57 | 57 | case 'created-date': |
58 | - echo getpaid_format_date_value( $invoice->get_date_created() ); |
|
58 | + echo getpaid_format_date_value($invoice->get_date_created()); |
|
59 | 59 | break; |
60 | 60 | |
61 | 61 | case 'payment-date': |
62 | - if ( $invoice->needs_payment() ) { |
|
62 | + if ($invoice->needs_payment()) { |
|
63 | 63 | echo '—'; |
64 | 64 | } else { |
65 | - echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
65 | + echo getpaid_format_date_value($invoice->get_date_completed()); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | break; |
69 | 69 | |
70 | 70 | case 'invoice-status': |
71 | - echo wp_kses_post( $invoice->get_status_label_html() ); |
|
71 | + echo wp_kses_post($invoice->get_status_label_html()); |
|
72 | 72 | |
73 | 73 | break; |
74 | 74 | |
75 | 75 | case 'invoice-total': |
76 | - echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
76 | + echo wpinv_price($invoice->get_total(), $invoice->get_currency()); |
|
77 | 77 | |
78 | 78 | break; |
79 | 79 | |
@@ -82,47 +82,47 @@ discard block |
||
82 | 82 | |
83 | 83 | 'pay' => array( |
84 | 84 | 'url' => $invoice->get_checkout_payment_url(), |
85 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
85 | + 'name' => __('Pay Now', 'invoicing'), |
|
86 | 86 | 'class' => 'btn-success', |
87 | 87 | ), |
88 | 88 | |
89 | 89 | 'print' => array( |
90 | 90 | 'url' => $invoice->get_view_url(), |
91 | - 'name' => __( 'View', 'invoicing' ), |
|
91 | + 'name' => __('View', 'invoicing'), |
|
92 | 92 | 'class' => 'btn-secondary', |
93 | 93 | 'attrs' => 'target="_blank"', |
94 | 94 | ), |
95 | 95 | ); |
96 | 96 | |
97 | - if ( ! $invoice->needs_payment() ) { |
|
98 | - unset( $actions['pay'] ); |
|
97 | + if (!$invoice->needs_payment()) { |
|
98 | + unset($actions['pay']); |
|
99 | 99 | } |
100 | 100 | |
101 | - if ( $invoice->needs_payment() ) { |
|
101 | + if ($invoice->needs_payment()) { |
|
102 | 102 | $actions['delete'] = array( |
103 | - 'url' => getpaid_get_authenticated_action_url( 'delete_invoice', add_query_arg( 'invoice_id', $invoice->get_id() ) ), |
|
104 | - 'name' => __( 'Delete', 'invoicing' ), |
|
103 | + 'url' => getpaid_get_authenticated_action_url('delete_invoice', add_query_arg('invoice_id', $invoice->get_id())), |
|
104 | + 'name' => __('Delete', 'invoicing'), |
|
105 | 105 | 'class' => 'btn-danger', |
106 | 106 | ); |
107 | 107 | } |
108 | 108 | |
109 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
109 | + $actions = apply_filters('wpinv_user_invoices_actions', $actions, $invoice, $post_type); |
|
110 | 110 | |
111 | - foreach ( $actions as $key => $action ) { |
|
112 | - $class = ! empty( $action['class'] ) ? sanitize_html_class( $action['class'] ) : ''; |
|
113 | - echo '<a href="' . esc_url( $action['url'] ) . '" class="btn btn-sm btn-block ' . $class . ' ' . sanitize_html_class( $key ) . '" ' . ( ! empty( $action['attrs'] ) ? $action['attrs'] : '' ) . '>' . $action['name'] . '</a>'; |
|
111 | + foreach ($actions as $key => $action) { |
|
112 | + $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
113 | + echo '<a href="' . esc_url($action['url']) . '" class="btn btn-sm btn-block ' . $class . ' ' . sanitize_html_class($key) . '" ' . (!empty($action['attrs']) ? $action['attrs'] : '') . '>' . $action['name'] . '</a>'; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | break; |
117 | 117 | |
118 | 118 | default: |
119 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
119 | + do_action("wpinv_user_invoices_column_$column_id", $invoice); |
|
120 | 120 | break; |
121 | 121 | |
122 | 122 | |
123 | 123 | } |
124 | 124 | |
125 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
125 | + do_action("wpinv_user_invoices_column_after_$column_id", $invoice); |
|
126 | 126 | |
127 | 127 | echo '</td>'; |
128 | 128 | |
@@ -136,16 +136,16 @@ discard block |
||
136 | 136 | </table> |
137 | 137 | </div> |
138 | 138 | |
139 | - <?php do_action( 'wpinv_before_user_invoices_pagination' ); ?> |
|
139 | + <?php do_action('wpinv_before_user_invoices_pagination'); ?> |
|
140 | 140 | |
141 | - <?php if ( 1 < $invoices->max_num_pages ) : ?> |
|
141 | + <?php if (1 < $invoices->max_num_pages) : ?> |
|
142 | 142 | <div class="invoicing-Pagination"> |
143 | 143 | <?php |
144 | 144 | $big = 999999; |
145 | 145 | |
146 | 146 | echo paginate_links( |
147 | 147 | array( |
148 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
148 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
149 | 149 | 'format' => '?paged=%#%', |
150 | 150 | 'total' => $invoices->max_num_pages, |
151 | 151 | ) |
@@ -154,4 +154,4 @@ discard block |
||
154 | 154 | </div> |
155 | 155 | <?php endif; ?> |
156 | 156 | |
157 | -<?php do_action( 'wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); ?> |
|
157 | +<?php do_action('wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); ?> |
@@ -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 | -$label = empty( $label ) ? '' : wp_kses_post( $label ); |
|
13 | -$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | +$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label)); |
|
14 | 14 | |
15 | -if ( ! empty( $required ) ) { |
|
15 | +if (!empty($required)) { |
|
16 | 16 | $label .= "<span class='text-danger'> *</span>"; |
17 | 17 | } |
18 | 18 | |
19 | 19 | echo aui()->input( |
20 | 20 | array( |
21 | 21 | 'type' => 'checkbox', |
22 | - 'name' => esc_attr( $id ), |
|
23 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
24 | - 'required' => ! empty( $required ), |
|
22 | + 'name' => esc_attr($id), |
|
23 | + 'id' => esc_attr($id) . uniqid('_'), |
|
24 | + 'required' => !empty($required), |
|
25 | 25 | 'label' => $label, |
26 | - 'value' => esc_attr__( 'Yes', 'invoicing' ), |
|
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'value' => esc_attr__('Yes', 'invoicing'), |
|
27 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
28 | 28 | 'class' => 'w-auto ' . $label_class, |
29 | 29 | ) |
30 | 30 | ); |
@@ -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 | -$label = empty( $label ) ? '' : wp_kses_post( $label ); |
|
13 | -$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | +$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label)); |
|
14 | 14 | |
15 | -if ( ! empty( $required ) ) { |
|
15 | +if (!empty($required)) { |
|
16 | 16 | $label .= "<span class='text-danger'> *</span>"; |
17 | 17 | } |
18 | 18 | |
19 | 19 | echo aui()->input( |
20 | 20 | array( |
21 | - 'name' => esc_attr( $id ), |
|
22 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
23 | - 'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
24 | - 'required' => ! empty( $required ), |
|
21 | + 'name' => esc_attr($id), |
|
22 | + 'id' => esc_attr($id) . uniqid('_'), |
|
23 | + 'placeholder' => empty($placeholder) ? '' : esc_attr($placeholder), |
|
24 | + 'required' => !empty($required), |
|
25 | 25 | 'label' => $label, |
26 | 26 | 'label_type' => 'vertical', |
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
27 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
28 | 28 | 'type' => 'email', |
29 | 29 | 'class' => $label_class, |
30 | 30 | ) |
@@ -64,8 +64,8 @@ |
||
64 | 64 | $description = wpinv_get_gateway_description( $gateway ); |
65 | 65 | |
66 | 66 | if ( wpinv_is_test_mode( $gateway ) ) { |
67 | - $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
68 | - $description = "$description $sandbox_notice"; |
|
67 | + $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
68 | + $description = "$description $sandbox_notice"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | echo wpautop( wp_kses_post( $description ) ); |
@@ -7,45 +7,45 @@ discard block |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // The payment methods select title. |
13 | -if ( empty( $text ) ) { |
|
14 | - $text = __( 'Select Payment Method', 'invoicing' ); |
|
13 | +if (empty($text)) { |
|
14 | + $text = __('Select Payment Method', 'invoicing'); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // An array of active payment methods. |
18 | -$gateways = wpinv_get_enabled_payment_gateways( true ); |
|
18 | +$gateways = wpinv_get_enabled_payment_gateways(true); |
|
19 | 19 | |
20 | 20 | // The current invoice id. |
21 | 21 | $invoice_id = 0; |
22 | 22 | $chosen_gateway = wpinv_get_default_gateway(); |
23 | 23 | |
24 | -if ( ! empty( $form->invoice ) ) { |
|
24 | +if (!empty($form->invoice)) { |
|
25 | 25 | $invoice_id = $form->invoice->get_id(); |
26 | 26 | $chosen_gateway = $form->invoice->get_gateway(); |
27 | 27 | } |
28 | 28 | |
29 | 29 | ?> |
30 | 30 | |
31 | - <?php do_action( 'getpaid_before_payment_form_gateway_select', $form ); ?> |
|
31 | + <?php do_action('getpaid_before_payment_form_gateway_select', $form); ?> |
|
32 | 32 | <div class="mt-4 mb-4 getpaid-gateways"> |
33 | 33 | |
34 | - <?php do_action( 'wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form ); ?> |
|
34 | + <?php do_action('wpinv_payment_mode_top', $invoice_id, $chosen_gateway, $gateways, $form); ?> |
|
35 | 35 | |
36 | 36 | <div class="getpaid-select-gateway-title-div"> |
37 | - <h6><?php echo esc_html( $text ); ?></h6> |
|
37 | + <h6><?php echo esc_html($text); ?></h6> |
|
38 | 38 | </div> |
39 | 39 | |
40 | 40 | <div class="getpaid-available-gateways-div"> |
41 | 41 | |
42 | - <?php foreach ( array_keys( $gateways ) as $gateway ) : ?> |
|
42 | + <?php foreach (array_keys($gateways) as $gateway) : ?> |
|
43 | 43 | |
44 | - <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class( $gateway ); ?>" data-checkout-label='<?php echo esc_attr( apply_filters( "getpaid_gateway_{$gateway}_checkout_button_label", '' ) ); ?>'> |
|
44 | + <div class="pt-1 pb-1 getpaid-gateway getpaid-gateway-<?php echo sanitize_html_class($gateway); ?>" data-checkout-label='<?php echo esc_attr(apply_filters("getpaid_gateway_{$gateway}_checkout_button_label", '')); ?>'> |
|
45 | 45 | |
46 | 46 | <label class="d-block w-100 getpaid-gateway-radio"> |
47 | - <input type="radio" value="<?php echo esc_attr( $gateway ); ?>" <?php checked( $gateway, $chosen_gateway ); ?> name="wpi-gateway"> |
|
48 | - <span><?php echo esc_html( wpinv_get_gateway_checkout_label( $gateway ) ); ?></span> |
|
47 | + <input type="radio" value="<?php echo esc_attr($gateway); ?>" <?php checked($gateway, $chosen_gateway); ?> name="wpi-gateway"> |
|
48 | + <span><?php echo esc_html(wpinv_get_gateway_checkout_label($gateway)); ?></span> |
|
49 | 49 | </label> |
50 | 50 | |
51 | 51 | </div> |
@@ -56,22 +56,22 @@ discard block |
||
56 | 56 | |
57 | 57 | <div class="getpaid-gateway-descriptions-div"> |
58 | 58 | |
59 | - <?php foreach ( array_keys( $gateways ) as $gateway ) : ?> |
|
59 | + <?php foreach (array_keys($gateways) as $gateway) : ?> |
|
60 | 60 | |
61 | - <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class( $gateway ); ?>" style="display: none;"> |
|
61 | + <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo sanitize_html_class($gateway); ?>" style="display: none;"> |
|
62 | 62 | <?php |
63 | 63 | |
64 | - $description = wpinv_get_gateway_description( $gateway ); |
|
64 | + $description = wpinv_get_gateway_description($gateway); |
|
65 | 65 | |
66 | - if ( wpinv_is_test_mode( $gateway ) ) { |
|
67 | - $sandbox_notice = apply_filters( "getpaid_{$gateway}_sandbox_notice", __( 'SANDBOX ENABLED: No real payments will occur.', 'invoicing' ) ); |
|
66 | + if (wpinv_is_test_mode($gateway)) { |
|
67 | + $sandbox_notice = apply_filters("getpaid_{$gateway}_sandbox_notice", __('SANDBOX ENABLED: No real payments will occur.', 'invoicing')); |
|
68 | 68 | $description = "$description $sandbox_notice"; |
69 | 69 | } |
70 | 70 | |
71 | - echo wpautop( wp_kses_post( $description ) ); |
|
71 | + echo wpautop(wp_kses_post($description)); |
|
72 | 72 | |
73 | - do_action( 'wpinv_' . $gateway . '_checkout_fields', $invoice_id ); |
|
74 | - do_action( 'wpinv_' . $gateway . '_cc_form', $invoice_id, $form ); |
|
73 | + do_action('wpinv_' . $gateway . '_checkout_fields', $invoice_id); |
|
74 | + do_action('wpinv_' . $gateway . '_cc_form', $invoice_id, $form); |
|
75 | 75 | |
76 | 76 | ?> |
77 | 77 | </div> |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | <?php |
85 | 85 | echo aui()->alert( |
86 | 86 | array( |
87 | - 'content' => __( 'None of the available payment gateways support purchasing recurring items.', 'invoicing' ), |
|
87 | + 'content' => __('None of the available payment gateways support purchasing recurring items.', 'invoicing'), |
|
88 | 88 | 'type' => 'danger', |
89 | 89 | ) |
90 | 90 | ); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | <?php |
96 | 96 | echo aui()->alert( |
97 | 97 | array( |
98 | - 'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ), |
|
98 | + 'content' => __('None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing'), |
|
99 | 99 | 'type' => 'danger', |
100 | 100 | ) |
101 | 101 | ); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | <?php |
107 | 107 | echo aui()->alert( |
108 | 108 | array( |
109 | - 'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ), |
|
109 | + 'content' => __('None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing'), |
|
110 | 110 | 'type' => 'danger', |
111 | 111 | ) |
112 | 112 | ); |
@@ -117,14 +117,14 @@ discard block |
||
117 | 117 | <?php |
118 | 118 | echo aui()->alert( |
119 | 119 | array( |
120 | - 'content' => __( 'There is no active payment gateway available to process your request.', 'invoicing' ), |
|
120 | + 'content' => __('There is no active payment gateway available to process your request.', 'invoicing'), |
|
121 | 121 | 'type' => 'danger', |
122 | 122 | ) |
123 | 123 | ); |
124 | 124 | ?> |
125 | 125 | </div> |
126 | 126 | |
127 | - <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?> |
|
127 | + <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?> |
|
128 | 128 | |
129 | 129 | </div> |
130 | - <?php do_action( 'getpaid_after_payment_form_gateway_select', $form ); ?> |
|
130 | + <?php do_action('getpaid_after_payment_form_gateway_select', $form); ?> |
@@ -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 | -$label = empty( $label ) ? '' : wp_kses_post( $label ); |
|
13 | -$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | +$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label)); |
|
14 | 14 | |
15 | -if ( ! empty( $required ) ) { |
|
15 | +if (!empty($required)) { |
|
16 | 16 | $label .= "<span class='text-danger'> *</span>"; |
17 | 17 | } |
18 | 18 | |
19 | 19 | echo aui()->input( |
20 | 20 | array( |
21 | - 'name' => esc_attr( $id ), |
|
22 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
23 | - 'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
24 | - 'required' => ! empty( $required ), |
|
21 | + 'name' => esc_attr($id), |
|
22 | + 'id' => esc_attr($id) . uniqid('_'), |
|
23 | + 'placeholder' => empty($placeholder) ? '' : esc_attr($placeholder), |
|
24 | + 'required' => !empty($required), |
|
25 | 25 | 'label' => $label, |
26 | 26 | 'label_type' => 'vertical', |
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
27 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
28 | 28 | 'class' => $label_class, |
29 | 29 | ) |
30 | 30 | ); |