@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @version 1.0.0 |
6 | 6 | */ |
7 | 7 | |
8 | -defined( 'ABSPATH' ) || exit; |
|
8 | +defined('ABSPATH') || exit; |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Contains the subscriptions widget. |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | 'block-keywords' => "['invoicing','subscriptions', 'getpaid']", |
28 | 28 | 'class_name' => __CLASS__, |
29 | 29 | 'base_id' => 'wpinv_subscriptions', |
30 | - 'name' => __( 'GetPaid > Subscriptions', 'invoicing' ), |
|
30 | + 'name' => __('GetPaid > Subscriptions', 'invoicing'), |
|
31 | 31 | 'widget_ops' => array( |
32 | 32 | 'classname' => 'getpaid-subscriptions bsui', |
33 | - 'description' => esc_html__( "Displays the current user's subscriptions.", 'invoicing' ), |
|
33 | + 'description' => esc_html__("Displays the current user's subscriptions.", 'invoicing'), |
|
34 | 34 | ), |
35 | 35 | 'arguments' => array( |
36 | 36 | 'title' => array( |
37 | - 'title' => __( 'Widget title', 'invoicing' ), |
|
38 | - 'desc' => __( 'Enter widget title.', 'invoicing' ), |
|
37 | + 'title' => __('Widget title', 'invoicing'), |
|
38 | + 'desc' => __('Enter widget title.', 'invoicing'), |
|
39 | 39 | 'type' => 'text', |
40 | 40 | 'desc_tip' => true, |
41 | 41 | 'default' => '', |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | ); |
47 | 47 | |
48 | - parent::__construct( $options ); |
|
48 | + parent::__construct($options); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | public function get_subscriptions() { |
57 | 57 | |
58 | 58 | // Prepare license args. |
59 | - $args = array( |
|
59 | + $args = array( |
|
60 | 60 | 'customer_in' => get_current_user_id(), |
61 | - 'paged' => ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1, |
|
61 | + 'paged' => (get_query_var('paged')) ? absint(get_query_var('paged')) : 1, |
|
62 | 62 | ); |
63 | 63 | |
64 | - return new GetPaid_Subscriptions_Query( $args ); |
|
64 | + return new GetPaid_Subscriptions_Query($args); |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | |
@@ -74,14 +74,14 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return mixed|string|bool |
76 | 76 | */ |
77 | - public function output( $args = array(), $widget_args = array(), $content = '' ) { |
|
77 | + public function output($args = array(), $widget_args = array(), $content = '') { |
|
78 | 78 | |
79 | 79 | // Ensure that the user is logged in. |
80 | - if ( ! is_user_logged_in() ) { |
|
80 | + if (!is_user_logged_in()) { |
|
81 | 81 | |
82 | 82 | return aui()->alert( |
83 | 83 | array( |
84 | - 'content' => wp_kses_post( __( 'You need to log-in or create an account to view this section.', 'invoicing' ) ), |
|
84 | + 'content' => wp_kses_post(__('You need to log-in or create an account to view this section.', 'invoicing')), |
|
85 | 85 | 'type' => 'error', |
86 | 86 | ) |
87 | 87 | ); |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | // Are we displaying a single subscription? |
92 | - if ( isset( $_GET['subscription'] ) ) { |
|
93 | - return $this->display_single_subscription( intval( $_GET['subscription'] ) ); |
|
92 | + if (isset($_GET['subscription'])) { |
|
93 | + return $this->display_single_subscription(intval($_GET['subscription'])); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | // Retrieve the user's subscriptions. |
@@ -100,27 +100,27 @@ discard block |
||
100 | 100 | ob_start(); |
101 | 101 | |
102 | 102 | // Backwards compatibility. |
103 | - do_action( 'wpinv_before_user_subscriptions' ); |
|
103 | + do_action('wpinv_before_user_subscriptions'); |
|
104 | 104 | |
105 | 105 | // Display errors and notices. |
106 | 106 | wpinv_print_errors(); |
107 | 107 | |
108 | - do_action( 'getpaid_license_manager_before_subscriptions', $subscriptions ); |
|
108 | + do_action('getpaid_license_manager_before_subscriptions', $subscriptions); |
|
109 | 109 | |
110 | 110 | // Print the table header. |
111 | 111 | $this->print_table_header(); |
112 | 112 | |
113 | 113 | // Print table body. |
114 | - $this->print_table_body( $subscriptions->get_results() ); |
|
114 | + $this->print_table_body($subscriptions->get_results()); |
|
115 | 115 | |
116 | 116 | // Print table footer. |
117 | 117 | $this->print_table_footer(); |
118 | 118 | |
119 | 119 | // Print the navigation. |
120 | - $this->print_navigation( $subscriptions->get_total() ); |
|
120 | + $this->print_navigation($subscriptions->get_total()); |
|
121 | 121 | |
122 | 122 | // Backwards compatibility. |
123 | - do_action( 'wpinv_after_user_subscriptions' ); |
|
123 | + do_action('wpinv_after_user_subscriptions'); |
|
124 | 124 | |
125 | 125 | // Return the output. |
126 | 126 | return ob_get_clean(); |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | public function get_subscriptions_table_columns() { |
136 | 136 | |
137 | 137 | $columns = array( |
138 | - 'subscription' => __( 'Subscription', 'invoicing' ), |
|
139 | - 'amount' => __( 'Amount', 'invoicing' ), |
|
140 | - 'renewal-date' => __( 'Next payment', 'invoicing' ), |
|
141 | - 'status' => __( 'Status', 'invoicing' ), |
|
138 | + 'subscription' => __('Subscription', 'invoicing'), |
|
139 | + 'amount' => __('Amount', 'invoicing'), |
|
140 | + 'renewal-date' => __('Next payment', 'invoicing'), |
|
141 | + 'status' => __('Status', 'invoicing'), |
|
142 | 142 | ); |
143 | 143 | |
144 | - return apply_filters( 'getpaid_frontend_subscriptions_table_columns', $columns ); |
|
144 | + return apply_filters('getpaid_frontend_subscriptions_table_columns', $columns); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | |
157 | 157 | <thead> |
158 | 158 | <tr> |
159 | - <?php foreach ( $this->get_subscriptions_table_columns() as $key => $label ) : ?> |
|
160 | - <th scope="col" class="font-weight-bold getpaid-subscriptions-table-<?php echo esc_attr( $key ); ?>"> |
|
161 | - <?php echo esc_html( $label ); ?> |
|
159 | + <?php foreach ($this->get_subscriptions_table_columns() as $key => $label) : ?> |
|
160 | + <th scope="col" class="font-weight-bold getpaid-subscriptions-table-<?php echo esc_attr($key); ?>"> |
|
161 | + <?php echo esc_html($label); ?> |
|
162 | 162 | </th> |
163 | 163 | <?php endforeach; ?> |
164 | 164 | </tr> |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @param WPInv_Subscription[] $subscriptions |
175 | 175 | */ |
176 | - public function print_table_body( $subscriptions ) { |
|
176 | + public function print_table_body($subscriptions) { |
|
177 | 177 | |
178 | - if ( empty( $subscriptions ) ) { |
|
178 | + if (empty($subscriptions)) { |
|
179 | 179 | $this->print_table_body_no_subscriptions(); |
180 | 180 | } else { |
181 | - $this->print_table_body_subscriptions( $subscriptions ); |
|
181 | + $this->print_table_body_subscriptions($subscriptions); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | } |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | <tbody> |
194 | 194 | |
195 | 195 | <tr> |
196 | - <td colspan="<?php echo count( $this->get_subscriptions_table_columns() ); ?>"> |
|
196 | + <td colspan="<?php echo count($this->get_subscriptions_table_columns()); ?>"> |
|
197 | 197 | |
198 | 198 | <?php |
199 | 199 | aui()->alert( |
200 | 200 | array( |
201 | - 'content' => wp_kses_post( __( 'No subscriptions found.', 'invoicing' ) ), |
|
201 | + 'content' => wp_kses_post(__('No subscriptions found.', 'invoicing')), |
|
202 | 202 | 'type' => 'warning', |
203 | 203 | ), |
204 | 204 | true |
@@ -217,12 +217,12 @@ discard block |
||
217 | 217 | * |
218 | 218 | * @param WPInv_Subscription[] $subscriptions |
219 | 219 | */ |
220 | - public function print_table_body_subscriptions( $subscriptions ) { |
|
220 | + public function print_table_body_subscriptions($subscriptions) { |
|
221 | 221 | |
222 | 222 | ?> |
223 | 223 | <tbody> |
224 | 224 | |
225 | - <?php foreach ( $subscriptions as $subscription ) : ?> |
|
225 | + <?php foreach ($subscriptions as $subscription) : ?> |
|
226 | 226 | <tr class="getpaid-subscriptions-table-row subscription-<?php echo (int) $subscription->get_id(); ?>"> |
227 | 227 | <?php |
228 | 228 | wpinv_get_template( |
@@ -248,28 +248,28 @@ discard block |
||
248 | 248 | * @since 1.0.0 |
249 | 249 | * @return string |
250 | 250 | */ |
251 | - public function add_row_actions( $content, $subscription ) { |
|
251 | + public function add_row_actions($content, $subscription) { |
|
252 | 252 | |
253 | 253 | // Prepare row actions. |
254 | 254 | $actions = array(); |
255 | 255 | |
256 | 256 | // View subscription action. |
257 | - $view_url = getpaid_get_tab_url( 'gp-subscriptions', get_permalink( (int) wpinv_get_option( 'invoice_subscription_page' ) ) ); |
|
258 | - $view_url = esc_url( add_query_arg( 'subscription', (int) $subscription->get_id(), $view_url ) ); |
|
259 | - $actions['view'] = "<a href='$view_url' class='text-decoration-none'>" . __( 'Manage Subscription', 'invoicing' ) . '</a>'; |
|
257 | + $view_url = getpaid_get_tab_url('gp-subscriptions', get_permalink((int) wpinv_get_option('invoice_subscription_page'))); |
|
258 | + $view_url = esc_url(add_query_arg('subscription', (int) $subscription->get_id(), $view_url)); |
|
259 | + $actions['view'] = "<a href='$view_url' class='text-decoration-none'>" . __('Manage Subscription', 'invoicing') . '</a>'; |
|
260 | 260 | |
261 | 261 | // Filter the actions. |
262 | - $actions = apply_filters( 'getpaid_subscriptions_table_subscription_actions', $actions, $subscription ); |
|
262 | + $actions = apply_filters('getpaid_subscriptions_table_subscription_actions', $actions, $subscription); |
|
263 | 263 | |
264 | - $sanitized = array(); |
|
265 | - foreach ( $actions as $key => $action ) { |
|
266 | - $key = sanitize_html_class( $key ); |
|
267 | - $action = wp_kses_post( $action ); |
|
264 | + $sanitized = array(); |
|
265 | + foreach ($actions as $key => $action) { |
|
266 | + $key = sanitize_html_class($key); |
|
267 | + $action = wp_kses_post($action); |
|
268 | 268 | $sanitized[] = "<span class='$key'>$action</span>"; |
269 | 269 | } |
270 | 270 | |
271 | 271 | $row_actions = "<small class='form-text getpaid-subscription-item-actions'>"; |
272 | - $row_actions .= implode( ' | ', $sanitized ); |
|
272 | + $row_actions .= implode(' | ', $sanitized); |
|
273 | 273 | $row_actions .= '</small>'; |
274 | 274 | |
275 | 275 | return $content . $row_actions; |
@@ -285,9 +285,9 @@ discard block |
||
285 | 285 | |
286 | 286 | <tfoot> |
287 | 287 | <tr> |
288 | - <?php foreach ( $this->get_subscriptions_table_columns() as $key => $label ) : ?> |
|
289 | - <th class="font-weight-bold getpaid-subscriptions-<?php echo esc_attr( $key ); ?>"> |
|
290 | - <?php echo esc_html( $label ); ?> |
|
288 | + <?php foreach ($this->get_subscriptions_table_columns() as $key => $label) : ?> |
|
289 | + <th class="font-weight-bold getpaid-subscriptions-<?php echo esc_attr($key); ?>"> |
|
290 | + <?php echo esc_html($label); ?> |
|
291 | 291 | </th> |
292 | 292 | <?php endforeach; ?> |
293 | 293 | </tr> |
@@ -303,22 +303,22 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @param int $total |
305 | 305 | */ |
306 | - public function print_navigation( $total ) { |
|
306 | + public function print_navigation($total) { |
|
307 | 307 | |
308 | - if ( $total < 1 ) { |
|
308 | + if ($total < 1) { |
|
309 | 309 | |
310 | 310 | // Out-of-bounds, run the query again without LIMIT for total count. |
311 | - $args = array( |
|
311 | + $args = array( |
|
312 | 312 | 'customer_in' => get_current_user_id(), |
313 | 313 | 'fields' => 'id', |
314 | 314 | ); |
315 | 315 | |
316 | - $count_query = new GetPaid_Subscriptions_Query( $args ); |
|
316 | + $count_query = new GetPaid_Subscriptions_Query($args); |
|
317 | 317 | $total = $count_query->get_total(); |
318 | 318 | } |
319 | 319 | |
320 | 320 | // Abort if we do not have pages. |
321 | - if ( 2 > $total ) { |
|
321 | + if (2 > $total) { |
|
322 | 322 | return; |
323 | 323 | } |
324 | 324 | |
@@ -331,9 +331,9 @@ discard block |
||
331 | 331 | echo wp_kses_post( |
332 | 332 | getpaid_paginate_links( |
333 | 333 | array( |
334 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
334 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
335 | 335 | 'format' => '?paged=%#%', |
336 | - 'total' => (int) ceil( $total / 10 ), |
|
336 | + 'total' => (int) ceil($total / 10), |
|
337 | 337 | ) |
338 | 338 | ) |
339 | 339 | ); |
@@ -350,42 +350,42 @@ discard block |
||
350 | 350 | * |
351 | 351 | * @return array |
352 | 352 | */ |
353 | - public function get_single_subscription_columns( $subscription ) { |
|
353 | + public function get_single_subscription_columns($subscription) { |
|
354 | 354 | |
355 | 355 | // Prepare subscription detail columns. |
356 | - $subscription_group = getpaid_get_invoice_subscription_group( $subscription->get_parent_invoice_id(), $subscription->get_id() ); |
|
357 | - $items_count = empty( $subscription_group ) ? 1 : count( $subscription_group['items'] ); |
|
356 | + $subscription_group = getpaid_get_invoice_subscription_group($subscription->get_parent_invoice_id(), $subscription->get_id()); |
|
357 | + $items_count = empty($subscription_group) ? 1 : count($subscription_group['items']); |
|
358 | 358 | $fields = apply_filters( |
359 | 359 | 'getpaid_single_subscription_details_fields', |
360 | 360 | array( |
361 | - 'status' => __( 'Status', 'invoicing' ), |
|
362 | - 'initial_amount' => __( 'Initial amount', 'invoicing' ), |
|
363 | - 'recurring_amount' => __( 'Recurring amount', 'invoicing' ), |
|
364 | - 'start_date' => __( 'Start date', 'invoicing' ), |
|
365 | - 'expiry_date' => __( 'Next payment', 'invoicing' ), |
|
366 | - 'payments' => __( 'Payments', 'invoicing' ), |
|
367 | - 'item' => _n( 'Item', 'Items', $items_count, 'invoicing' ), |
|
361 | + 'status' => __('Status', 'invoicing'), |
|
362 | + 'initial_amount' => __('Initial amount', 'invoicing'), |
|
363 | + 'recurring_amount' => __('Recurring amount', 'invoicing'), |
|
364 | + 'start_date' => __('Start date', 'invoicing'), |
|
365 | + 'expiry_date' => __('Next payment', 'invoicing'), |
|
366 | + 'payments' => __('Payments', 'invoicing'), |
|
367 | + 'item' => _n('Item', 'Items', $items_count, 'invoicing'), |
|
368 | 368 | ), |
369 | 369 | $subscription |
370 | 370 | ); |
371 | 371 | |
372 | - if ( isset( $fields['expiry_date'] ) ) { |
|
372 | + if (isset($fields['expiry_date'])) { |
|
373 | 373 | |
374 | - if ( ! $subscription->is_active() || $subscription->is_last_renewal() ) { |
|
375 | - $fields['expiry_date'] = __( 'End date', 'invoicing' ); |
|
374 | + if (!$subscription->is_active() || $subscription->is_last_renewal()) { |
|
375 | + $fields['expiry_date'] = __('End date', 'invoicing'); |
|
376 | 376 | } |
377 | 377 | |
378 | - if ( 'pending' == $subscription->get_status() ) { |
|
379 | - unset( $fields['expiry_date'] ); |
|
378 | + if ('pending' == $subscription->get_status()) { |
|
379 | + unset($fields['expiry_date']); |
|
380 | 380 | } |
381 | 381 | } |
382 | 382 | |
383 | - if ( isset( $fields['start_date'] ) && 'pending' == $subscription->get_status() ) { |
|
384 | - unset( $fields['start_date'] ); |
|
383 | + if (isset($fields['start_date']) && 'pending' == $subscription->get_status()) { |
|
384 | + unset($fields['start_date']); |
|
385 | 385 | } |
386 | 386 | |
387 | - if ( $subscription->get_initial_amount() == $subscription->get_recurring_amount() ) { |
|
388 | - unset( $fields['initial_amount'] ); |
|
387 | + if ($subscription->get_initial_amount() == $subscription->get_recurring_amount()) { |
|
388 | + unset($fields['initial_amount']); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | return $fields; |
@@ -398,16 +398,16 @@ discard block |
||
398 | 398 | * |
399 | 399 | * @return string |
400 | 400 | */ |
401 | - public function display_single_subscription( $subscription ) { |
|
401 | + public function display_single_subscription($subscription) { |
|
402 | 402 | |
403 | 403 | // Fetch the subscription. |
404 | - $subscription = new WPInv_Subscription( (int) $subscription ); |
|
404 | + $subscription = new WPInv_Subscription((int) $subscription); |
|
405 | 405 | |
406 | - if ( ! $subscription->exists() ) { |
|
406 | + if (!$subscription->exists()) { |
|
407 | 407 | |
408 | 408 | return aui()->alert( |
409 | 409 | array( |
410 | - 'content' => wp_kses_post( __( 'Subscription not found.', 'invoicing' ) ), |
|
410 | + 'content' => wp_kses_post(__('Subscription not found.', 'invoicing')), |
|
411 | 411 | 'type' => 'error', |
412 | 412 | ) |
413 | 413 | ); |
@@ -415,11 +415,11 @@ discard block |
||
415 | 415 | } |
416 | 416 | |
417 | 417 | // Ensure that the user owns this subscription key. |
418 | - if ( get_current_user_id() != $subscription->get_customer_id() && ! wpinv_current_user_can_manage_invoicing() ) { |
|
418 | + if (get_current_user_id() != $subscription->get_customer_id() && !wpinv_current_user_can_manage_invoicing()) { |
|
419 | 419 | |
420 | 420 | return aui()->alert( |
421 | 421 | array( |
422 | - 'content' => wp_kses_post( __( 'You do not have permission to view this subscription. Ensure that you are logged in to the account that owns the subscription.', 'invoicing' ) ), |
|
422 | + 'content' => wp_kses_post(__('You do not have permission to view this subscription. Ensure that you are logged in to the account that owns the subscription.', 'invoicing')), |
|
423 | 423 | 'type' => 'error', |
424 | 424 | ) |
425 | 425 | ); |
@@ -7,50 +7,50 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -$class = ! is_singular( 'page' ) ? 'px-1' : ''; |
|
12 | +$class = !is_singular('page') ? 'px-1' : ''; |
|
13 | 13 | ?> |
14 | 14 | |
15 | - <?php do_action( 'getpaid_before_invoice_meta', $invoice ); ?> |
|
15 | + <?php do_action('getpaid_before_invoice_meta', $invoice); ?> |
|
16 | 16 | <div class="getpaid-invoice-meta-data"> |
17 | 17 | |
18 | - <?php do_action( 'getpaid_before_invoice_meta_table', $invoice ); ?> |
|
18 | + <?php do_action('getpaid_before_invoice_meta_table', $invoice); ?> |
|
19 | 19 | <table class="table table-bordered"> |
20 | 20 | <tbody> |
21 | 21 | |
22 | - <?php do_action( 'getpaid_before_invoice_meta_rows', $invoice ); ?> |
|
23 | - <?php foreach ( $meta as $key => $data ) : ?> |
|
22 | + <?php do_action('getpaid_before_invoice_meta_rows', $invoice); ?> |
|
23 | + <?php foreach ($meta as $key => $data) : ?> |
|
24 | 24 | |
25 | - <?php if ( ! empty( $data['value'] ) ) : ?> |
|
25 | + <?php if (!empty($data['value'])) : ?> |
|
26 | 26 | |
27 | - <?php do_action( "getpaid_before_invoice_meta_$key", $invoice, $data ); ?> |
|
27 | + <?php do_action("getpaid_before_invoice_meta_$key", $invoice, $data); ?> |
|
28 | 28 | |
29 | - <tr class="getpaid-invoice-meta-<?php echo esc_attr( $key ); ?>"> |
|
29 | + <tr class="getpaid-invoice-meta-<?php echo esc_attr($key); ?>"> |
|
30 | 30 | |
31 | - <th class="<?php echo esc_attr( $class ); ?> font-weight-bold" style="width: 40%"> |
|
32 | - <?php echo esc_html( $data['label'] ); ?> |
|
31 | + <th class="<?php echo esc_attr($class); ?> font-weight-bold" style="width: 40%"> |
|
32 | + <?php echo esc_html($data['label']); ?> |
|
33 | 33 | </th> |
34 | 34 | |
35 | - <td class="<?php echo esc_attr( $class ); ?> <?php echo $key == 'invoice_total' ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break" style="width: 60%"> |
|
36 | - <span class="getpaid-invoice-meta-<?php echo esc_attr( $key ); ?>-value"><?php echo wp_kses_post( $data['value'] ); ?></span> |
|
35 | + <td class="<?php echo esc_attr($class); ?> <?php echo $key == 'invoice_total' ? 'font-weight-bold' : 'font-weight-normal'; ?> text-break" style="width: 60%"> |
|
36 | + <span class="getpaid-invoice-meta-<?php echo esc_attr($key); ?>-value"><?php echo wp_kses_post($data['value']); ?></span> |
|
37 | 37 | </td> |
38 | 38 | |
39 | 39 | </tr> |
40 | 40 | |
41 | - <?php do_action( "getpaid_after_invoice_meta_$key", $invoice, $data ); ?> |
|
41 | + <?php do_action("getpaid_after_invoice_meta_$key", $invoice, $data); ?> |
|
42 | 42 | |
43 | 43 | <?php endif; ?> |
44 | 44 | |
45 | 45 | <?php endforeach; ?> |
46 | - <?php do_action( 'getpaid_after_invoice_meta_rows', $invoice ); ?> |
|
46 | + <?php do_action('getpaid_after_invoice_meta_rows', $invoice); ?> |
|
47 | 47 | |
48 | 48 | </tbody> |
49 | 49 | </table> |
50 | - <?php do_action( 'getpaid_after_invoice_meta_table', $invoice ); ?> |
|
50 | + <?php do_action('getpaid_after_invoice_meta_table', $invoice); ?> |
|
51 | 51 | |
52 | 52 | |
53 | 53 | </div> |
54 | - <?php do_action( 'getpaid_after_invoice_meta', $invoice ); ?> |
|
54 | + <?php do_action('getpaid_after_invoice_meta', $invoice); ?> |
|
55 | 55 | |
56 | 56 | <?php |
@@ -10,89 +10,89 @@ |
||
10 | 10 | * @var array $columns |
11 | 11 | */ |
12 | 12 | |
13 | -defined( 'ABSPATH' ) || exit; |
|
13 | +defined('ABSPATH') || exit; |
|
14 | 14 | |
15 | -do_action( 'getpaid_before_invoice_line_item', $invoice, $item ); |
|
15 | +do_action('getpaid_before_invoice_line_item', $invoice, $item); |
|
16 | 16 | |
17 | 17 | ?> |
18 | 18 | |
19 | -<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo esc_attr( $item->get_type() ); ?> border-bottom'> |
|
19 | +<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo esc_attr($item->get_type()); ?> border-bottom'> |
|
20 | 20 | |
21 | 21 | <div class="form-row"> |
22 | 22 | |
23 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
23 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
24 | 24 | |
25 | - <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo esc_attr( $column ); ?>"> |
|
25 | + <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo esc_attr($column); ?>"> |
|
26 | 26 | |
27 | 27 | <?php |
28 | 28 | |
29 | 29 | // Fires before printing a line item column. |
30 | - do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice ); |
|
30 | + do_action("getpaid_invoice_line_item_before_$column", $item, $invoice); |
|
31 | 31 | |
32 | 32 | // Item name. |
33 | - if ( 'name' == $column ) { |
|
33 | + if ('name' == $column) { |
|
34 | 34 | |
35 | 35 | // Display the name. |
36 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
36 | + echo '<div class="mb-1">' . esc_html($item->get_name()) . '</div>'; |
|
37 | 37 | |
38 | 38 | // And an optional description. |
39 | 39 | $description = $item->get_description(); |
40 | 40 | |
41 | - if ( ! empty( $description ) ) { |
|
42 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . "</small>"; |
|
41 | + if (!empty($description)) { |
|
42 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post($description) . "</small>"; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | // Fires before printing the line item actions. |
46 | - do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
46 | + do_action('getpaid_before_invoice_line_item_actions', $item, $invoice); |
|
47 | 47 | |
48 | - $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
48 | + $actions = apply_filters('getpaid-invoice-page-line-item-actions', array(), $item, $invoice); |
|
49 | 49 | |
50 | - if ( ! empty( $actions ) ) { |
|
50 | + if (!empty($actions)) { |
|
51 | 51 | |
52 | - $sanitized = array(); |
|
53 | - foreach ( $actions as $key => $action ) { |
|
54 | - $key = sanitize_html_class( $key ); |
|
55 | - $action = wp_kses_post( $action ); |
|
52 | + $sanitized = array(); |
|
53 | + foreach ($actions as $key => $action) { |
|
54 | + $key = sanitize_html_class($key); |
|
55 | + $action = wp_kses_post($action); |
|
56 | 56 | $sanitized[] = "<span class='$key'>$action</span>"; |
57 | 57 | } |
58 | 58 | |
59 | 59 | echo "<small class='form-text getpaid-line-item-actions'>"; |
60 | - echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
60 | + echo wp_kses_post(implode(' | ', $sanitized)); |
|
61 | 61 | echo '</small>'; |
62 | 62 | |
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | 66 | // Item price. |
67 | - if ( 'price' == $column ) { |
|
67 | + if ('price' == $column) { |
|
68 | 68 | |
69 | 69 | // Display the item price (or recurring price if this is a renewal invoice) |
70 | 70 | $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
71 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
71 | + wpinv_the_price($price, $invoice->get_currency()); |
|
72 | 72 | |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Tax rate. |
76 | - if ( 'tax_rate' == $column ) { |
|
77 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
76 | + if ('tax_rate' == $column) { |
|
77 | + echo floatval(round(getpaid_get_invoice_tax_rate($invoice, $item), 2)) . '%'; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // Item quantity. |
81 | - if ( 'quantity' == $column ) { |
|
81 | + if ('quantity' == $column) { |
|
82 | 82 | echo (float) $item->get_quantity(); |
83 | 83 | } |
84 | 84 | |
85 | 85 | // Item sub total. |
86 | - if ( 'subtotal' == $column ) { |
|
86 | + if ('subtotal' == $column) { |
|
87 | 87 | $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
88 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
88 | + wpinv_the_price($subtotal, $invoice->get_currency()); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | // Fires when printing a line item column. |
92 | - do_action( "getpaid_invoice_line_item_$column", $item, $invoice ); |
|
92 | + do_action("getpaid_invoice_line_item_$column", $item, $invoice); |
|
93 | 93 | |
94 | 94 | // Fires after printing a line item column. |
95 | - do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice ); |
|
95 | + do_action("getpaid_invoice_line_item_after_$column", $item, $invoice); |
|
96 | 96 | |
97 | 97 | ?> |
98 | 98 |
@@ -9,26 +9,26 @@ discard block |
||
9 | 9 | * @var WPInv_Invoice $invoice |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | 14 | // Totals rows. |
15 | -$totals = getpaid_invoice_totals_rows( $invoice ); |
|
15 | +$totals = getpaid_invoice_totals_rows($invoice); |
|
16 | 16 | |
17 | -do_action( 'getpaid_before_invoice_line_totals', $invoice, $totals ); |
|
17 | +do_action('getpaid_before_invoice_line_totals', $invoice, $totals); |
|
18 | 18 | |
19 | 19 | ?> |
20 | 20 | <div class='getpaid-invoice-line-totals'> |
21 | 21 | <div class="row"> |
22 | 22 | <div class="col-12 offset-sm-6 col-sm-6 border-sm-left pl-sm-0"> |
23 | 23 | |
24 | - <?php foreach ( $totals as $key => $label ) : ?> |
|
24 | + <?php foreach ($totals as $key => $label) : ?> |
|
25 | 25 | |
26 | - <div class="getpaid-invoice-line-totals-col <?php echo esc_attr( $key ); ?>"> |
|
26 | + <div class="getpaid-invoice-line-totals-col <?php echo esc_attr($key); ?>"> |
|
27 | 27 | |
28 | 28 | <div class="form-row"> |
29 | 29 | |
30 | 30 | <div class="col-8 getpaid-invoice-line-totals-label"> |
31 | - <?php echo esc_html( $label ); ?> |
|
31 | + <?php echo esc_html($label); ?> |
|
32 | 32 | </div> |
33 | 33 | |
34 | 34 | <div class="col-4 getpaid-invoice-line-totals-value pl-0"> |
@@ -36,47 +36,47 @@ discard block |
||
36 | 36 | <?php |
37 | 37 | |
38 | 38 | // Total tax. |
39 | - if ( 'tax' == $key ) { |
|
40 | - wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
|
39 | + if ('tax' == $key) { |
|
40 | + wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency()); |
|
41 | 41 | |
42 | - if ( wpinv_use_taxes() && ! $invoice->get_disable_taxes() ) { |
|
42 | + if (wpinv_use_taxes() && !$invoice->get_disable_taxes()) { |
|
43 | 43 | |
44 | 44 | $taxes = $invoice->get_total_tax(); |
45 | - if ( empty( $taxes ) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction( $invoice->get_country() ) ) { |
|
45 | + if (empty($taxes) && GetPaid_Payment_Form_Submission_Taxes::is_eu_transaction($invoice->get_country())) { |
|
46 | 46 | echo ' <em class="text-muted small">'; |
47 | - _x( '(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing' ); |
|
47 | + _x('(Reverse charged)', 'This is a legal term for reverse charging tax in the EU', 'invoicing'); |
|
48 | 48 | echo '</em>'; |
49 | 49 | } |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | // Total Fee. |
54 | - if ( 'fee' == $key ) { |
|
55 | - wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
54 | + if ('fee' == $key) { |
|
55 | + wpinv_the_price($invoice->get_total_fees(), $invoice->get_currency()); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | // Total discount. |
59 | - if ( 'discount' == $key ) { |
|
60 | - wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
59 | + if ('discount' == $key) { |
|
60 | + wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency()); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // Shipping. |
64 | - if ( 'shipping' == $key ) { |
|
65 | - wpinv_the_price( $invoice->get_shipping(), $invoice->get_currency() ); |
|
64 | + if ('shipping' == $key) { |
|
65 | + wpinv_the_price($invoice->get_shipping(), $invoice->get_currency()); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // Sub total. |
69 | - if ( 'subtotal' == $key ) { |
|
70 | - wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
69 | + if ('subtotal' == $key) { |
|
70 | + wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency()); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // Total. |
74 | - if ( 'total' == $key ) { |
|
75 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
74 | + if ('total' == $key) { |
|
75 | + wpinv_the_price($invoice->get_total(), $invoice->get_currency()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | // Fires when printing a cart total. |
79 | - do_action( "getpaid_invoice_cart_totals_$key", $invoice ); |
|
79 | + do_action("getpaid_invoice_cart_totals_$key", $invoice); |
|
80 | 80 | |
81 | 81 | ?> |
82 | 82 | |
@@ -90,4 +90,4 @@ discard block |
||
90 | 90 | </div> |
91 | 91 | </div> <!-- end .getpaid-invoice-line-totals --> |
92 | 92 | |
93 | -<?php do_action( 'getpaid_after_invoice_line_totals', $invoice, $totals ); ?> |
|
93 | +<?php do_action('getpaid_after_invoice_line_totals', $invoice, $totals); ?> |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | * @var array $fee |
10 | 10 | */ |
11 | 11 | |
12 | -defined( 'ABSPATH' ) || exit; |
|
12 | +defined('ABSPATH') || exit; |
|
13 | 13 | |
14 | -do_action( 'getpaid_before_invoice_fee_item', $invoice, $fee ); |
|
14 | +do_action('getpaid_before_invoice_fee_item', $invoice, $fee); |
|
15 | 15 | |
16 | 16 | ?> |
17 | 17 | |
@@ -19,64 +19,64 @@ discard block |
||
19 | 19 | |
20 | 20 | <div class="form-row"> |
21 | 21 | |
22 | - <?php foreach ( array_keys( $columns ) as $column ) : ?> |
|
22 | + <?php foreach (array_keys($columns) as $column) : ?> |
|
23 | 23 | |
24 | - <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo esc_attr( $column ); ?>"> |
|
24 | + <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm'; ?> getpaid-invoice-item-<?php echo esc_attr($column); ?>"> |
|
25 | 25 | |
26 | 26 | <?php |
27 | 27 | |
28 | 28 | // Fires before printing a fee item column. |
29 | - do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice ); |
|
29 | + do_action("getpaid_invoice_fee_item_before_$column", $fee, $invoice); |
|
30 | 30 | |
31 | 31 | // Item name. |
32 | - if ( 'name' == $column ) { |
|
32 | + if ('name' == $column) { |
|
33 | 33 | |
34 | 34 | // Display the name. |
35 | - echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
35 | + echo '<div class="mb-1">' . esc_html($fee['name']) . '</div>'; |
|
36 | 36 | |
37 | 37 | // And an optional description. |
38 | - $description = empty( $fee['description'] ) ? esc_html__( 'Fee', 'invoicing' ) : esc_html( $fee['description'] ); |
|
39 | - echo wp_kses_post( "<small class='form-text text-muted pr-2 m-0'>$description</small>" ); |
|
38 | + $description = empty($fee['description']) ? esc_html__('Fee', 'invoicing') : esc_html($fee['description']); |
|
39 | + echo wp_kses_post("<small class='form-text text-muted pr-2 m-0'>$description</small>"); |
|
40 | 40 | |
41 | 41 | } |
42 | 42 | |
43 | 43 | // Item price. |
44 | - if ( 'price' == $column ) { |
|
44 | + if ('price' == $column) { |
|
45 | 45 | |
46 | 46 | // Display the item price (or recurring price if this is a renewal invoice) |
47 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
48 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
47 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
48 | + wpinv_the_price($fee['recurring_fee'], $invoice->get_currency()); |
|
49 | 49 | } else { |
50 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
50 | + wpinv_the_price($fee['initial_fee'], $invoice->get_currency()); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | 54 | // Item quantity. |
55 | - if ( 'quantity' == $column ) { |
|
55 | + if ('quantity' == $column) { |
|
56 | 56 | echo '—'; |
57 | 57 | } |
58 | 58 | |
59 | 59 | // Item tax. |
60 | - if ( 'tax_rate' == $column ) { |
|
60 | + if ('tax_rate' == $column) { |
|
61 | 61 | echo '—'; |
62 | 62 | } |
63 | 63 | |
64 | 64 | // Item sub total. |
65 | - if ( 'subtotal' == $column ) { |
|
65 | + if ('subtotal' == $column) { |
|
66 | 66 | |
67 | 67 | // Display the item price (or recurring price if this is a renewal invoice) |
68 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
69 | - wpinv_the_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
68 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
69 | + wpinv_the_price($fee['recurring_fee'], $invoice->get_currency()); |
|
70 | 70 | } else { |
71 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
71 | + wpinv_the_price($fee['initial_fee'], $invoice->get_currency()); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Fires when printing a fee item column. |
76 | - do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice ); |
|
76 | + do_action("getpaid_invoice_fee_item_$column", $fee, $invoice); |
|
77 | 77 | |
78 | 78 | // Fires after printing a fee item column. |
79 | - do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice ); |
|
79 | + do_action("getpaid_invoice_fee_item_after_$column", $fee, $invoice); |
|
80 | 80 | |
81 | 81 | ?> |
82 | 82 |
@@ -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 esc_attr( $invoice->get_template() ); ?>"> |
|
21 | + <div class="getpaid-invoice-items-header <?php echo esc_attr($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); ?> |
@@ -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 esc_html_e( 'Subscription Details', 'invoicing' ); ?></h2> |
|
34 | +<h2 class="mb-1 h4"><?php esc_html_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 esc_attr( $key ); ?>"> |
|
40 | + <tr class="getpaid-subscription-meta-<?php echo esc_attr($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 wp_kses_post( wpinv_price( $subscription->get_initial_amount(), $subscription->get_parent_payment()->get_currency() ) ); |
|
64 | + echo wp_kses_post(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 | - esc_html_x( '( %1$s trial )', 'Subscription trial period. (e.g.: 1 month trial)', 'invoicing' ), |
|
71 | - esc_html( $subscription->get_trial_period() ) |
|
70 | + esc_html_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 esc_html_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 esc_html_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 esc_html_e( 'Related Invoices', 'invoicing' ); ?></h2> |
|
119 | +<h2 class='mt-5 mb-1 h4'><?php esc_html_e('Related Invoices', 'invoicing'); ?></h2> |
|
120 | 120 | |
121 | -<?php echo wp_kses_post( getpaid_admin_subscription_invoice_details_metabox( $subscription ) ); ?> |
|
121 | +<?php echo wp_kses_post(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 esc_html_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 esc_html_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 | - esc_html__( 'Cancel Subscription', 'invoicing' ) |
|
134 | + esc_url($subscription->get_cancel_url()), |
|
135 | + esc_attr__('Are you sure you want to cancel this subscription?', 'invoicing'), |
|
136 | + esc_html__('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 esc_html_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 esc_html_e('Go Back', 'invoicing'); ?></a> |
|
144 | 144 | </span> |
@@ -42,92 +42,92 @@ discard block |
||
42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo esc_attr( $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='" . esc_attr( $column_id . ' ' . $class ) . "'>"; |
|
51 | - switch ( $column_id ) { |
|
50 | + echo "<td class='" . esc_attr( $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 esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
59 | - break; |
|
57 | + case 'created-date': |
|
58 | + echo esc_html( 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 esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
66 | - } |
|
61 | + case 'payment-date': |
|
62 | + if ( $invoice->needs_payment() ) { |
|
63 | + echo '—'; |
|
64 | + } else { |
|
65 | + echo esc_html( 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 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
75 | + case 'invoice-total': |
|
76 | + wpinv_the_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 ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $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 ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $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,18 +141,18 @@ discard block |
||
141 | 141 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
142 | 142 | <div class="invoicing-Pagination"> |
143 | 143 | <?php |
144 | - $big = 999999; |
|
145 | - |
|
146 | - echo wp_kses_post( |
|
147 | - paginate_links( |
|
148 | - array( |
|
149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
150 | - 'format' => '?paged=%#%', |
|
151 | - 'total' => $invoices->max_num_pages, |
|
152 | - ) |
|
153 | - ) |
|
144 | + $big = 999999; |
|
145 | + |
|
146 | + echo wp_kses_post( |
|
147 | + paginate_links( |
|
148 | + array( |
|
149 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
150 | + 'format' => '?paged=%#%', |
|
151 | + 'total' => $invoices->max_num_pages, |
|
152 | + ) |
|
153 | + ) |
|
154 | 154 | ); |
155 | - ?> |
|
155 | + ?> |
|
156 | 156 | </div> |
157 | 157 | <?php endif; ?> |
158 | 158 |
@@ -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 esc_attr( $post_type ); ?>"> |
|
22 | + <table class="table table-bordered table-hover getpaid-user-invoices <?php echo esc_attr($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 esc_attr( $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 esc_attr($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 esc_attr( $invoice->get_status() ); ?>"> |
|
42 | + <tr class="wpinv-item wpinv-item-<?php echo esc_attr($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='" . esc_attr( $column_id . ' ' . $class ) . "'>"; |
|
51 | - switch ( $column_id ) { |
|
50 | + echo "<td class='" . esc_attr($column_id . ' ' . $class) . "'>"; |
|
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 esc_html( getpaid_format_date_value( $invoice->get_date_created() ) ); |
|
58 | + echo esc_html(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 esc_html( getpaid_format_date_value( $invoice->get_date_completed() ) ); |
|
65 | + echo esc_html(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 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
76 | + wpinv_the_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 ' . esc_attr( $class . ' ' . sanitize_html_class( $key ) ) . '" ' . ( ! empty( $action['attrs'] ) ? esc_html( $action['attrs'] ) : '' ) . '>' . esc_attr( $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 ' . esc_attr($class . ' ' . sanitize_html_class($key)) . '" ' . (!empty($action['attrs']) ? esc_html($action['attrs']) : '') . '>' . esc_attr($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,9 +136,9 @@ 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; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | echo wp_kses_post( |
147 | 147 | paginate_links( |
148 | 148 | array( |
149 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
149 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
150 | 150 | 'format' => '?paged=%#%', |
151 | 151 | 'total' => $invoices->max_num_pages, |
152 | 152 | ) |
@@ -156,4 +156,4 @@ discard block |
||
156 | 156 | </div> |
157 | 157 | <?php endif; ?> |
158 | 158 | |
159 | -<?php do_action( 'wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); ?> |
|
159 | +<?php do_action('wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); ?> |
@@ -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 esc_attr( $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 esc_attr($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 esc_attr( $gateway ); ?>" style="display: none;"> |
|
61 | + <div class="my-2 p-3 bg-light border getpaid-gateway-description getpaid-description-<?php echo esc_attr($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 wp_kses_post( wpautop( $description ) ); |
|
71 | + echo wp_kses_post(wpautop($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 | 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 | true |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | <?php |
97 | 97 | aui()->alert( |
98 | 98 | array( |
99 | - 'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing' ), |
|
99 | + 'content' => __('None of the available payment gateways support purchasing multiple subscriptions in a single order.', 'invoicing'), |
|
100 | 100 | 'type' => 'danger', |
101 | 101 | ), |
102 | 102 | true |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | <?php |
109 | 109 | aui()->alert( |
110 | 110 | array( |
111 | - 'content' => __( 'None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing' ), |
|
111 | + 'content' => __('None of the available payment gateways support purchasing multiple subscriptions with different billing schedules in a single order.', 'invoicing'), |
|
112 | 112 | 'type' => 'danger', |
113 | 113 | ), |
114 | 114 | true |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | <?php |
121 | 121 | aui()->alert( |
122 | 122 | array( |
123 | - 'content' => __( 'There is no active payment gateway available to process your request.', 'invoicing' ), |
|
123 | + 'content' => __('There is no active payment gateway available to process your request.', 'invoicing'), |
|
124 | 124 | 'type' => 'danger', |
125 | 125 | ), |
126 | 126 | true |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | ?> |
129 | 129 | </div> |
130 | 130 | |
131 | - <?php do_action( 'wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form ); ?> |
|
131 | + <?php do_action('wpinv_payment_mode_bottom', $invoice_id, $chosen_gateway, $gateways, $form); ?> |
|
132 | 132 | |
133 | 133 | </div> |
134 | - <?php do_action( 'getpaid_after_payment_form_gateway_select', $form ); ?> |
|
134 | + <?php do_action('getpaid_after_payment_form_gateway_select', $form); ?> |