@@ -42,86 +42,86 @@ discard block |
||
| 42 | 42 | <tr class="wpinv-item wpinv-item-<?php echo $invoice_status = $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 wpinv_invoice_link( $invoice ); |
|
| 55 | - break; |
|
| 53 | + case 'invoice-number': |
|
| 54 | + echo 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': |
|
| 61 | + case 'payment-date': |
|
| 62 | 62 | |
| 63 | - if ( $invoice->needs_payment() ) { |
|
| 64 | - echo "—"; |
|
| 65 | - } else { |
|
| 66 | - echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
| 67 | - } |
|
| 63 | + if ( $invoice->needs_payment() ) { |
|
| 64 | + echo "—"; |
|
| 65 | + } else { |
|
| 66 | + echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - break; |
|
| 69 | + break; |
|
| 70 | 70 | |
| 71 | - case 'invoice-status': |
|
| 72 | - echo $invoice->get_status_label_html(); |
|
| 71 | + case 'invoice-status': |
|
| 72 | + echo $invoice->get_status_label_html(); |
|
| 73 | 73 | |
| 74 | - break; |
|
| 74 | + break; |
|
| 75 | 75 | |
| 76 | - case 'invoice-total': |
|
| 77 | - echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 76 | + case 'invoice-total': |
|
| 77 | + echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 78 | 78 | |
| 79 | - break; |
|
| 79 | + break; |
|
| 80 | 80 | |
| 81 | - case 'invoice-actions': |
|
| 81 | + case 'invoice-actions': |
|
| 82 | 82 | |
| 83 | - $actions = array( |
|
| 83 | + $actions = array( |
|
| 84 | 84 | |
| 85 | - 'pay' => array( |
|
| 86 | - 'url' => $invoice->get_checkout_payment_url(), |
|
| 87 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 88 | - 'class' => 'btn-success' |
|
| 89 | - ), |
|
| 85 | + 'pay' => array( |
|
| 86 | + 'url' => $invoice->get_checkout_payment_url(), |
|
| 87 | + 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 88 | + 'class' => 'btn-success' |
|
| 89 | + ), |
|
| 90 | 90 | |
| 91 | - 'print' => array( |
|
| 92 | - 'url' => $invoice->get_view_url(), |
|
| 93 | - 'name' => __( 'View', 'invoicing' ), |
|
| 94 | - 'class' => 'btn-secondary', |
|
| 95 | - 'attrs' => 'target="_blank"' |
|
| 96 | - ) |
|
| 97 | - ); |
|
| 91 | + 'print' => array( |
|
| 92 | + 'url' => $invoice->get_view_url(), |
|
| 93 | + 'name' => __( 'View', 'invoicing' ), |
|
| 94 | + 'class' => 'btn-secondary', |
|
| 95 | + 'attrs' => 'target="_blank"' |
|
| 96 | + ) |
|
| 97 | + ); |
|
| 98 | 98 | |
| 99 | - if ( ! $invoice->needs_payment() ) { |
|
| 100 | - unset( $actions['pay'] ); |
|
| 101 | - } |
|
| 99 | + if ( ! $invoice->needs_payment() ) { |
|
| 100 | + unset( $actions['pay'] ); |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 103 | + $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 104 | 104 | |
| 105 | - foreach ( $actions as $key => $action ) { |
|
| 106 | - $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
| 107 | - 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>'; |
|
| 108 | - } |
|
| 105 | + foreach ( $actions as $key => $action ) { |
|
| 106 | + $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
|
| 107 | + 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>'; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - break; |
|
| 110 | + break; |
|
| 111 | 111 | |
| 112 | - default: |
|
| 113 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 114 | - break; |
|
| 112 | + default: |
|
| 113 | + do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 114 | + break; |
|
| 115 | 115 | |
| 116 | 116 | |
| 117 | - } |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 119 | + do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 120 | 120 | |
| 121 | - echo '</td>'; |
|
| 121 | + echo '</td>'; |
|
| 122 | 122 | |
| 123 | - endforeach; |
|
| 124 | - ?> |
|
| 123 | + endforeach; |
|
| 124 | + ?> |
|
| 125 | 125 | </tr> |
| 126 | 126 | |
| 127 | 127 | <?php endforeach; ?> |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | <?php if ( 1 < $invoices->max_num_pages ) : ?> |
| 136 | 136 | <div class="invoicing-Pagination"> |
| 137 | 137 | <?php |
| 138 | - $big = 999999; |
|
| 139 | - |
|
| 140 | - echo paginate_links( array( |
|
| 141 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 142 | - 'format' => '?paged=%#%', |
|
| 143 | - 'total' => $invoices->max_num_pages, |
|
| 144 | - ) ); |
|
| 145 | - ?> |
|
| 138 | + $big = 999999; |
|
| 139 | + |
|
| 140 | + echo paginate_links( array( |
|
| 141 | + 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 142 | + 'format' => '?paged=%#%', |
|
| 143 | + 'total' => $invoices->max_num_pages, |
|
| 144 | + ) ); |
|
| 145 | + ?> |
|
| 146 | 146 | </div> |
| 147 | 147 | <?php endif; ?> |
| 148 | 148 | |
@@ -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,33 +37,33 @@ 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 | 42 | <tr class="wpinv-item wpinv-item-<?php echo $invoice_status = $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 wpinv_invoice_link( $invoice ); |
|
| 54 | + echo 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 | 62 | |
| 63 | - if ( $invoice->needs_payment() ) { |
|
| 63 | + if ($invoice->needs_payment()) { |
|
| 64 | 64 | echo "—"; |
| 65 | 65 | } else { |
| 66 | - echo getpaid_format_date_value( $invoice->get_date_completed() ); |
|
| 66 | + echo getpaid_format_date_value($invoice->get_date_completed()); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | break; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | break; |
| 75 | 75 | |
| 76 | 76 | case 'invoice-total': |
| 77 | - echo wpinv_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 77 | + echo wpinv_price($invoice->get_total(), $invoice->get_currency()); |
|
| 78 | 78 | |
| 79 | 79 | break; |
| 80 | 80 | |
@@ -84,39 +84,39 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | 'pay' => array( |
| 86 | 86 | 'url' => $invoice->get_checkout_payment_url(), |
| 87 | - 'name' => __( 'Pay Now', 'invoicing' ), |
|
| 87 | + 'name' => __('Pay Now', 'invoicing'), |
|
| 88 | 88 | 'class' => 'btn-success' |
| 89 | 89 | ), |
| 90 | 90 | |
| 91 | 91 | 'print' => array( |
| 92 | 92 | 'url' => $invoice->get_view_url(), |
| 93 | - 'name' => __( 'View', 'invoicing' ), |
|
| 93 | + 'name' => __('View', 'invoicing'), |
|
| 94 | 94 | 'class' => 'btn-secondary', |
| 95 | 95 | 'attrs' => 'target="_blank"' |
| 96 | 96 | ) |
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | - if ( ! $invoice->needs_payment() ) { |
|
| 100 | - unset( $actions['pay'] ); |
|
| 99 | + if (!$invoice->needs_payment()) { |
|
| 100 | + unset($actions['pay']); |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $actions = apply_filters( 'wpinv_user_invoices_actions', $actions, $invoice, $post_type ); |
|
| 103 | + $actions = apply_filters('wpinv_user_invoices_actions', $actions, $invoice, $post_type); |
|
| 104 | 104 | |
| 105 | - foreach ( $actions as $key => $action ) { |
|
| 105 | + foreach ($actions as $key => $action) { |
|
| 106 | 106 | $class = !empty($action['class']) ? sanitize_html_class($action['class']) : ''; |
| 107 | - 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>'; |
|
| 107 | + 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>'; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | break; |
| 111 | 111 | |
| 112 | 112 | default: |
| 113 | - do_action( "wpinv_user_invoices_column_$column_id", $invoice ); |
|
| 113 | + do_action("wpinv_user_invoices_column_$column_id", $invoice); |
|
| 114 | 114 | break; |
| 115 | 115 | |
| 116 | 116 | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - do_action( "wpinv_user_invoices_column_after_$column_id", $invoice ); |
|
| 119 | + do_action("wpinv_user_invoices_column_after_$column_id", $invoice); |
|
| 120 | 120 | |
| 121 | 121 | echo '</td>'; |
| 122 | 122 | |
@@ -130,20 +130,20 @@ discard block |
||
| 130 | 130 | </table> |
| 131 | 131 | </div> |
| 132 | 132 | |
| 133 | - <?php do_action( 'wpinv_before_user_invoices_pagination' ); ?> |
|
| 133 | + <?php do_action('wpinv_before_user_invoices_pagination'); ?> |
|
| 134 | 134 | |
| 135 | - <?php if ( 1 < $invoices->max_num_pages ) : ?> |
|
| 135 | + <?php if (1 < $invoices->max_num_pages) : ?> |
|
| 136 | 136 | <div class="invoicing-Pagination"> |
| 137 | 137 | <?php |
| 138 | 138 | $big = 999999; |
| 139 | 139 | |
| 140 | - echo paginate_links( array( |
|
| 141 | - 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), |
|
| 140 | + echo paginate_links(array( |
|
| 141 | + 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), |
|
| 142 | 142 | 'format' => '?paged=%#%', |
| 143 | 143 | 'total' => $invoices->max_num_pages, |
| 144 | - ) ); |
|
| 144 | + )); |
|
| 145 | 145 | ?> |
| 146 | 146 | </div> |
| 147 | 147 | <?php endif; ?> |
| 148 | 148 | |
| 149 | -<?php do_action( 'wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type ); ?> |
|
| 149 | +<?php do_action('wpinv_after_user_invoices', $invoices->invoices, $invoices->total, $invoices->max_num_pages, $post_type); ?> |
|