@@ -8,7 +8,7 @@ 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 | |
@@ -16,48 +16,48 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | <?php |
| 18 | 18 | |
| 19 | - $actions = array(); |
|
| 19 | + $actions = array(); |
|
| 20 | 20 | |
| 21 | 21 | echo sprintf( |
| 22 | 22 | '<a href="javascript:void(0)" class="btn btn-sm m-1 d-inline-block btn-secondary invoice-action-print d-none d-lg-inline-block" onclick="window.print();">%s</a>', |
| 23 | 23 | sprintf( |
| 24 | - esc_html__( 'Print %s', 'invoicing' ), |
|
| 25 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
| 24 | + esc_html__('Print %s', 'invoicing'), |
|
| 25 | + esc_html(ucfirst($invoice->get_invoice_quote_type())) |
|
| 26 | 26 | ) |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | - if ( is_user_logged_in() ) { |
|
| 29 | + if (is_user_logged_in()) { |
|
| 30 | 30 | |
| 31 | 31 | $actions[] = sprintf( |
| 32 | 32 | '<a href="%s" class="btn btn-sm btn-secondary m-1 d-inline-block invoice-action-history">%s</a>', |
| 33 | - esc_url( wpinv_get_history_page_uri( $invoice->get_post_type() ) ), |
|
| 33 | + esc_url(wpinv_get_history_page_uri($invoice->get_post_type())), |
|
| 34 | 34 | sprintf( |
| 35 | - __( '%s History', 'invoicing' ), |
|
| 36 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
| 35 | + __('%s History', 'invoicing'), |
|
| 36 | + esc_html(ucfirst($invoice->get_invoice_quote_type())) |
|
| 37 | 37 | ) |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if ( wpinv_current_user_can_manage_invoicing() ) { |
|
| 42 | + if (wpinv_current_user_can_manage_invoicing()) { |
|
| 43 | 43 | |
| 44 | 44 | $actions[] = sprintf( |
| 45 | 45 | '<a href="%s" class="btn btn-sm btn-secondary m-1 d-inline-block invoice-action-edit">%s</a>', |
| 46 | - esc_url( get_edit_post_link( $invoice->get_id() ) ), |
|
| 46 | + esc_url(get_edit_post_link($invoice->get_id())), |
|
| 47 | 47 | sprintf( |
| 48 | - __( 'Edit %s', 'invoicing' ), |
|
| 49 | - esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ) |
|
| 48 | + __('Edit %s', 'invoicing'), |
|
| 49 | + esc_html(ucfirst($invoice->get_invoice_quote_type())) |
|
| 50 | 50 | ) |
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $actions = apply_filters( 'getpaid_invoice_header_right_actions_array', $actions, $invoice ); |
|
| 56 | - echo wp_kses_post( implode( '', $actions ) ); |
|
| 55 | + $actions = apply_filters('getpaid_invoice_header_right_actions_array', $actions, $invoice); |
|
| 56 | + echo wp_kses_post(implode('', $actions)); |
|
| 57 | 57 | |
| 58 | 58 | ?> |
| 59 | 59 | |
| 60 | - <?php do_action( 'wpinv_invoice_display_right_actions', $invoice ); ?> |
|
| 60 | + <?php do_action('wpinv_invoice_display_right_actions', $invoice); ?> |
|
| 61 | 61 | </div> |
| 62 | 62 | |
| 63 | 63 | <?php |
@@ -7,11 +7,11 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | ?> |
| 13 | 13 | <h2 class="h3 text-dark"> |
| 14 | - <?php echo esc_html( apply_filters( 'getpaid_invoice_type_label', esc_html( ucfirst( $invoice->get_invoice_quote_type() ) ), $invoice ) ); ?> |
|
| 14 | + <?php echo esc_html(apply_filters('getpaid_invoice_type_label', esc_html(ucfirst($invoice->get_invoice_quote_type())), $invoice)); ?> |
|
| 15 | 15 | </h2> |
| 16 | 16 | |
| 17 | 17 | <?php |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -if ( ! empty( $element['text'] ) ) { |
|
| 13 | - echo '<p>' . wp_kses_post( trim( $element['text'] ) ) . '</p>'; |
|
| 12 | +if (!empty($element['text'])) { |
|
| 13 | + echo '<p>' . wp_kses_post(trim($element['text'])) . '</p>'; |
|
| 14 | 14 | } |
@@ -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 | -$heading_tag = isset( $element['level'] ) ? trim( sanitize_key( $element['level'] ) ) : 'h3'; |
|
| 13 | -$text = isset( $element['text'] ) ? trim( $element['text'] ) : ''; |
|
| 12 | +$heading_tag = isset($element['level']) ? trim(sanitize_key($element['level'])) : 'h3'; |
|
| 13 | +$text = isset($element['text']) ? trim($element['text']) : ''; |
|
| 14 | 14 | |
| 15 | -if ( ! empty( $text ) ) { |
|
| 16 | - echo wp_kses_post( "<$heading_tag>$text</$heading_tag>" ); |
|
| 15 | +if (!empty($text)) { |
|
| 16 | + echo wp_kses_post("<$heading_tag>$text</$heading_tag>"); |
|
| 17 | 17 | } |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // don't load directly |
| 3 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 4 | - die( '-1' ); |
|
| 3 | +if (!defined('ABSPATH')) { |
|
| 4 | + die('-1'); |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$email_footer = apply_filters( 'wpinv_email_footer_text', wpinv_get_option( 'email_footer_text', get_bloginfo( 'name', 'display' ) . ' - ' . __( 'Powered by GetPaid', 'invoicing' ) ) ); |
|
| 8 | -$email_footer = $email_footer ? wp_kses_post( wpautop( wptexturize( $email_footer ) ) ) : ''; |
|
| 7 | +$email_footer = apply_filters('wpinv_email_footer_text', wpinv_get_option('email_footer_text', get_bloginfo('name', 'display') . ' - ' . __('Powered by GetPaid', 'invoicing'))); |
|
| 8 | +$email_footer = $email_footer ? wp_kses_post(wpautop(wptexturize($email_footer))) : ''; |
|
| 9 | 9 | ?> |
| 10 | 10 | </div> |
| 11 | 11 | </td> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | <table border="0" cellpadding="10" cellspacing="0" width="100%"> |
| 28 | 28 | <tr> |
| 29 | 29 | <td colspan="2" valign="middle" id="credit"> |
| 30 | - <?php echo wp_kses_post( $email_footer ); ?> |
|
| 30 | + <?php echo wp_kses_post($email_footer); ?> |
|
| 31 | 31 | </td> |
| 32 | 32 | </tr> |
| 33 | 33 | </table> |
@@ -8,22 +8,22 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | // Totals rows. |
| 14 | -$totals = getpaid_invoice_totals_rows( $invoice ); |
|
| 14 | +$totals = getpaid_invoice_totals_rows($invoice); |
|
| 15 | 15 | |
| 16 | -do_action( 'getpaid_before_email_line_totals', $invoice, $totals ); |
|
| 16 | +do_action('getpaid_before_email_line_totals', $invoice, $totals); |
|
| 17 | 17 | |
| 18 | 18 | ?> |
| 19 | 19 | |
| 20 | 20 | |
| 21 | -<?php if ( has_action( 'wpinv_email_footer_buttons' ) ) : ?> |
|
| 21 | +<?php if (has_action('wpinv_email_footer_buttons')) : ?> |
|
| 22 | 22 | |
| 23 | 23 | <tr class="wpinv_cart_footer_row"> |
| 24 | 24 | |
| 25 | - <td colspan="<?php echo ( (int) $column_count ); ?>"> |
|
| 26 | - <?php do_action( 'wpinv_email_footer_buttons' ); ?> |
|
| 25 | + <td colspan="<?php echo ((int) $column_count); ?>"> |
|
| 26 | + <?php do_action('wpinv_email_footer_buttons'); ?> |
|
| 27 | 27 | </td> |
| 28 | 28 | |
| 29 | 29 | </tr> |
@@ -31,44 +31,44 @@ discard block |
||
| 31 | 31 | <?php endif; ?> |
| 32 | 32 | |
| 33 | 33 | |
| 34 | -<?php foreach ( $totals as $key => $label ) : ?> |
|
| 34 | +<?php foreach ($totals as $key => $label) : ?> |
|
| 35 | 35 | |
| 36 | - <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo esc_html( $key ); ?>_row"> |
|
| 36 | + <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo esc_html($key); ?>_row"> |
|
| 37 | 37 | |
| 38 | - <td colspan="<?php echo absint( ( $column_count - 1 ) ); ?>" class="wpinv_cart_<?php echo esc_html( $key ); ?>_label text-right"> |
|
| 39 | - <strong><?php echo esc_html( $label ); ?>:</strong> |
|
| 38 | + <td colspan="<?php echo absint(($column_count - 1)); ?>" class="wpinv_cart_<?php echo esc_html($key); ?>_label text-right"> |
|
| 39 | + <strong><?php echo esc_html($label); ?>:</strong> |
|
| 40 | 40 | </td> |
| 41 | 41 | |
| 42 | - <td class="wpinv_cart_<?php echo esc_html( $key ); ?> text-right"> |
|
| 42 | + <td class="wpinv_cart_<?php echo esc_html($key); ?> text-right"> |
|
| 43 | 43 | |
| 44 | 44 | <?php |
| 45 | 45 | |
| 46 | 46 | // Total tax. |
| 47 | - if ( 'tax' == $key ) { |
|
| 48 | - wpinv_the_price( $invoice->get_total_tax(), $invoice->get_currency() ); |
|
| 47 | + if ('tax' == $key) { |
|
| 48 | + wpinv_the_price($invoice->get_total_tax(), $invoice->get_currency()); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if ( 'fee' == $key ) { |
|
| 52 | - wpinv_the_price( $invoice->get_total_fees(), $invoice->get_currency() ); |
|
| 51 | + if ('fee' == $key) { |
|
| 52 | + wpinv_the_price($invoice->get_total_fees(), $invoice->get_currency()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Total discount. |
| 56 | - if ( 'discount' == $key ) { |
|
| 57 | - wpinv_the_price( $invoice->get_total_discount(), $invoice->get_currency() ); |
|
| 56 | + if ('discount' == $key) { |
|
| 57 | + wpinv_the_price($invoice->get_total_discount(), $invoice->get_currency()); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Sub total. |
| 61 | - if ( 'subtotal' == $key ) { |
|
| 62 | - wpinv_the_price( $invoice->get_subtotal(), $invoice->get_currency() ); |
|
| 61 | + if ('subtotal' == $key) { |
|
| 62 | + wpinv_the_price($invoice->get_subtotal(), $invoice->get_currency()); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Total. |
| 66 | - if ( 'total' == $key ) { |
|
| 67 | - wpinv_the_price( $invoice->get_total(), $invoice->get_currency() ); |
|
| 66 | + if ('total' == $key) { |
|
| 67 | + wpinv_the_price($invoice->get_total(), $invoice->get_currency()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // Fires when printing a cart total in an email. |
| 71 | - do_action( "getpaid_email_cart_totals_$key", $invoice ); |
|
| 71 | + do_action("getpaid_email_cart_totals_$key", $invoice); |
|
| 72 | 72 | |
| 73 | 73 | ?> |
| 74 | 74 | |
@@ -80,4 +80,4 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | <?php |
| 82 | 82 | |
| 83 | - do_action( 'getpaid_after_email_line_totals', $invoice, $totals ); |
|
| 83 | + do_action('getpaid_after_email_line_totals', $invoice, $totals); |
|
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 12 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 13 | 13 | |
| 14 | -do_action( 'wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note ); |
|
| 14 | +do_action('wpinv_email_before_note_details', $invoice, $email_type, $sent_to_admin, $customer_note); |
|
| 15 | 15 | |
| 16 | 16 | // Generate the custom message body. |
| 17 | -echo wp_kses_post( wptexturize( str_replace( '{customer_note}', $customer_note, $message_body ) ) ); |
|
| 17 | +echo wp_kses_post(wptexturize(str_replace('{customer_note}', $customer_note, $message_body))); |
|
| 18 | 18 | |
| 19 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 19 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 20 | 20 | |
| 21 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 21 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 22 | 22 | |
| 23 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 23 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 24 | 24 | |
| 25 | -do_action( 'wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note ); |
|
| 25 | +do_action('wpinv_email_after_note_details', $invoice, $email_type, $sent_to_admin, $customer_note); |
|
| 26 | 26 | |
| 27 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 27 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -7,64 +7,64 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Fetch the invoice. |
| 13 | -$invoice = new WPInv_Invoice( $invoice ); |
|
| 13 | +$invoice = new WPInv_Invoice($invoice); |
|
| 14 | 14 | |
| 15 | 15 | // @deprecated |
| 16 | -do_action( 'wpinv_success_content_before', $invoice ); |
|
| 17 | -do_action( 'wpinv_before_receipt', $invoice ); |
|
| 16 | +do_action('wpinv_success_content_before', $invoice); |
|
| 17 | +do_action('wpinv_before_receipt', $invoice); |
|
| 18 | 18 | |
| 19 | 19 | wpinv_print_errors(); |
| 20 | 20 | |
| 21 | 21 | // Prepare header text. |
| 22 | -if ( $invoice->is_paid() ) { |
|
| 22 | +if ($invoice->is_paid()) { |
|
| 23 | 23 | |
| 24 | 24 | $alert = aui()->alert( |
| 25 | 25 | array( |
| 26 | 26 | 'type' => 'success', |
| 27 | - 'content' => __( 'Thank you for your payment!', 'invoicing' ), |
|
| 27 | + 'content' => __('Thank you for your payment!', 'invoicing'), |
|
| 28 | 28 | ) |
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | -} elseif ( $invoice->is_refunded() ) { |
|
| 31 | +} elseif ($invoice->is_refunded()) { |
|
| 32 | 32 | |
| 33 | 33 | $alert = aui()->alert( |
| 34 | 34 | array( |
| 35 | 35 | 'type' => 'info', |
| 36 | - 'content' => __( 'This invoice was refunded.', 'invoicing' ), |
|
| 36 | + 'content' => __('This invoice was refunded.', 'invoicing'), |
|
| 37 | 37 | ) |
| 38 | 38 | ); |
| 39 | 39 | |
| 40 | -} elseif ( $invoice->is_held() ) { |
|
| 40 | +} elseif ($invoice->is_held()) { |
|
| 41 | 41 | |
| 42 | 42 | $alert = aui()->alert( |
| 43 | 43 | array( |
| 44 | 44 | 'type' => 'info', |
| 45 | - 'content' => __( 'This invoice will be processed as soon we verify your payment.', 'invoicing' ), |
|
| 45 | + 'content' => __('This invoice will be processed as soon we verify your payment.', 'invoicing'), |
|
| 46 | 46 | ) |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | -} elseif ( $invoice->needs_payment() ) { |
|
| 49 | +} elseif ($invoice->needs_payment()) { |
|
| 50 | 50 | |
| 51 | - if ( ! empty( $_GET['token'] ) ) { |
|
| 51 | + if (!empty($_GET['token'])) { |
|
| 52 | 52 | |
| 53 | 53 | $alert = aui()->alert( |
| 54 | 54 | array( |
| 55 | 55 | 'type' => 'info', |
| 56 | - 'content' => __( "Sometimes it takes a few minutes for us to verify your payment. We'll notify you as soon as we've verified the payment.", 'invoicing' ), |
|
| 56 | + 'content' => __("Sometimes it takes a few minutes for us to verify your payment. We'll notify you as soon as we've verified the payment.", 'invoicing'), |
|
| 57 | 57 | ) |
| 58 | 58 | ); |
| 59 | 59 | |
| 60 | - } elseif ( $invoice->is_due() ) { |
|
| 60 | + } elseif ($invoice->is_due()) { |
|
| 61 | 61 | |
| 62 | 62 | $alert = aui()->alert( |
| 63 | 63 | array( |
| 64 | 64 | 'type' => 'danger', |
| 65 | 65 | 'content' => sprintf( |
| 66 | - __( 'This invoice was due on %.', 'invoicing' ), |
|
| 67 | - getpaid_format_date_value( $invoice->get_due_date() ) |
|
| 66 | + __('This invoice was due on %.', 'invoicing'), |
|
| 67 | + getpaid_format_date_value($invoice->get_due_date()) |
|
| 68 | 68 | ), |
| 69 | 69 | ) |
| 70 | 70 | ); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $alert = aui()->alert( |
| 75 | 75 | array( |
| 76 | 76 | 'type' => 'warning', |
| 77 | - 'content' => __( 'This invoice needs payment.', 'invoicing' ), |
|
| 77 | + 'content' => __('This invoice needs payment.', 'invoicing'), |
|
| 78 | 78 | ) |
| 79 | 79 | ); |
| 80 | 80 | |
@@ -88,19 +88,19 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | 'pay' => array( |
| 90 | 90 | 'url' => $invoice->get_checkout_payment_url(), |
| 91 | - 'name' => __( 'Pay For Invoice', 'invoicing' ), |
|
| 91 | + 'name' => __('Pay For Invoice', 'invoicing'), |
|
| 92 | 92 | 'class' => 'btn-success', |
| 93 | 93 | ), |
| 94 | 94 | |
| 95 | 95 | 'view' => array( |
| 96 | 96 | 'url' => $invoice->get_view_url(), |
| 97 | - 'name' => __( 'View Invoice', 'invoicing' ), |
|
| 97 | + 'name' => __('View Invoice', 'invoicing'), |
|
| 98 | 98 | 'class' => 'btn-primary', |
| 99 | 99 | ), |
| 100 | 100 | |
| 101 | 101 | 'history' => array( |
| 102 | 102 | 'url' => wpinv_get_history_page_uri(), |
| 103 | - 'name' => __( 'Invoice History', 'invoicing' ), |
|
| 103 | + 'name' => __('Invoice History', 'invoicing'), |
|
| 104 | 104 | 'class' => 'btn-warning', |
| 105 | 105 | ), |
| 106 | 106 | |
@@ -108,12 +108,12 @@ discard block |
||
| 108 | 108 | $invoice |
| 109 | 109 | ); |
| 110 | 110 | |
| 111 | -if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $invoice_actions['pay'] ) ) { |
|
| 112 | - unset( $invoice_actions['pay'] ); |
|
| 111 | +if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($invoice_actions['pay'])) { |
|
| 112 | + unset($invoice_actions['pay']); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | -if ( ! is_user_logged_in() && isset( $invoice_actions['history'] ) ) { |
|
| 116 | - unset( $invoice_actions['history'] ); |
|
| 115 | +if (!is_user_logged_in() && isset($invoice_actions['history'])) { |
|
| 116 | + unset($invoice_actions['history']); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | ?> |
@@ -122,29 +122,29 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | <?php |
| 124 | 124 | |
| 125 | - do_action( 'wpinv_receipt_start', $invoice ); |
|
| 125 | + do_action('wpinv_receipt_start', $invoice); |
|
| 126 | 126 | |
| 127 | - if ( ! empty( $invoice_actions ) ) { |
|
| 127 | + if (!empty($invoice_actions)) { |
|
| 128 | 128 | |
| 129 | 129 | echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">'; |
| 130 | 130 | |
| 131 | - foreach ( $invoice_actions as $key => $invoice_action ) { |
|
| 131 | + foreach ($invoice_actions as $key => $invoice_action) { |
|
| 132 | 132 | |
| 133 | - $key = sanitize_html_class( $key ); |
|
| 134 | - $class = empty( $invoice_action['class'] ) ? 'btn-dark' : sanitize_html_class( $invoice_action['class'] ); |
|
| 135 | - $url = empty( $invoice_action['url'] ) ? '#' : esc_url( $invoice_action['url'] ); |
|
| 136 | - $attrs = empty( $invoice_action['attrs'] ) ? '' : $invoice_action['attrs']; |
|
| 137 | - $anchor = esc_html( $invoice_action['name'] ); |
|
| 133 | + $key = sanitize_html_class($key); |
|
| 134 | + $class = empty($invoice_action['class']) ? 'btn-dark' : sanitize_html_class($invoice_action['class']); |
|
| 135 | + $url = empty($invoice_action['url']) ? '#' : esc_url($invoice_action['url']); |
|
| 136 | + $attrs = empty($invoice_action['attrs']) ? '' : $invoice_action['attrs']; |
|
| 137 | + $anchor = esc_html($invoice_action['name']); |
|
| 138 | 138 | |
| 139 | - echo wp_kses_post( "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>" ); |
|
| 139 | + echo wp_kses_post("<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>"); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | echo '</div>'; |
| 143 | 143 | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - if ( ! empty( $alert ) ) { |
|
| 147 | - echo wp_kses_post( $alert ); |
|
| 146 | + if (!empty($alert)) { |
|
| 147 | + echo wp_kses_post($alert); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | ?> |
@@ -152,19 +152,19 @@ discard block |
||
| 152 | 152 | <div class="wpinv-receipt-details"> |
| 153 | 153 | |
| 154 | 154 | <h4 class="wpinv-details-t mb-3 mt-3"> |
| 155 | - <?php echo esc_html( apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ) ); ?> |
|
| 155 | + <?php echo esc_html(apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice)); ?> |
|
| 156 | 156 | </h4> |
| 157 | 157 | |
| 158 | - <?php getpaid_invoice_meta( $invoice ); ?> |
|
| 158 | + <?php getpaid_invoice_meta($invoice); ?> |
|
| 159 | 159 | |
| 160 | 160 | </div> |
| 161 | 161 | |
| 162 | - <?php do_action( 'wpinv_receipt_end', $invoice ); ?> |
|
| 162 | + <?php do_action('wpinv_receipt_end', $invoice); ?> |
|
| 163 | 163 | |
| 164 | 164 | </div> |
| 165 | 165 | |
| 166 | 166 | <?php |
| 167 | 167 | |
| 168 | 168 | // @deprecated |
| 169 | -do_action( 'wpinv_success_content_after', $invoice ); |
|
| 170 | -do_action( 'wpinv_after_receipt', $invoice ); |
|
| 169 | +do_action('wpinv_success_content_after', $invoice); |
|
| 170 | +do_action('wpinv_after_receipt', $invoice); |
|
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | // MUST have WordPress. |
| 10 | -if ( ! defined( 'WPINC' ) ) { |
|
| 10 | +if (!defined('WPINC')) { |
|
| 11 | 11 | exit; |
| 12 | 12 | } |
| 13 | 13 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | private static $instance; |
| 16 | 16 | |
| 17 | 17 | public static function run() { |
| 18 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof WPInv_Admin_Users ) ) { |
|
| 18 | + if (!isset(self::$instance) && !(self::$instance instanceof WPInv_Admin_Users)) { |
|
| 19 | 19 | self::$instance = new WPInv_Admin_Users(); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function __construct() { |
| 26 | - add_filter( 'manage_users_columns', array( $this, 'wpinv_add_user_column' ) ); |
|
| 27 | - add_filter( 'manage_users_custom_column', array( $this, 'wpinv_user_column_content' ), 10, 3 ); |
|
| 26 | + add_filter('manage_users_columns', array($this, 'wpinv_add_user_column')); |
|
| 27 | + add_filter('manage_users_custom_column', array($this, 'wpinv_user_column_content'), 10, 3); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @return mixed |
| 36 | 36 | */ |
| 37 | - public function wpinv_add_user_column( $column ) { |
|
| 38 | - $column['wpinvoicing'] = __( 'Invoicing', 'invoicing' ); |
|
| 37 | + public function wpinv_add_user_column($column) { |
|
| 38 | + $column['wpinvoicing'] = __('Invoicing', 'invoicing'); |
|
| 39 | 39 | return $column; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return string |
| 50 | 50 | */ |
| 51 | - public function wpinv_user_column_content( $val, $column_name, $user_id ) { |
|
| 52 | - switch ( $column_name ) { |
|
| 51 | + public function wpinv_user_column_content($val, $column_name, $user_id) { |
|
| 52 | + switch ($column_name) { |
|
| 53 | 53 | case 'wpinvoicing': |
| 54 | - return $this->get_user_invoices( $user_id ); |
|
| 54 | + return $this->get_user_invoices($user_id); |
|
| 55 | 55 | break; |
| 56 | 56 | default: |
| 57 | 57 | } |
@@ -65,30 +65,30 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @return string |
| 67 | 67 | */ |
| 68 | - public function get_user_invoices( $user_id ) { |
|
| 68 | + public function get_user_invoices($user_id) { |
|
| 69 | 69 | $output = ''; |
| 70 | 70 | $wp_query_args = array( |
| 71 | 71 | 'post_type' => 'wpi_invoice', |
| 72 | - 'post_status' => array( 'wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold', 'wpi-refunded', 'wpi-cancelled', 'wpi-failed', 'wpi-renewal' ), |
|
| 72 | + 'post_status' => array('wpi-pending', 'publish', 'wpi-processing', 'wpi-onhold', 'wpi-refunded', 'wpi-cancelled', 'wpi-failed', 'wpi-renewal'), |
|
| 73 | 73 | 'posts_per_page' => -1, |
| 74 | 74 | 'fields' => 'ids', |
| 75 | 75 | 'author' => $user_id, |
| 76 | 76 | ); |
| 77 | 77 | |
| 78 | - $wp_query_args = apply_filters( 'wpinv_get_user_invoices_args', $wp_query_args, $user_id ); |
|
| 78 | + $wp_query_args = apply_filters('wpinv_get_user_invoices_args', $wp_query_args, $user_id); |
|
| 79 | 79 | |
| 80 | - $invoices = new WP_Query( $wp_query_args ); |
|
| 81 | - $count = absint( $invoices->found_posts ); |
|
| 80 | + $invoices = new WP_Query($wp_query_args); |
|
| 81 | + $count = absint($invoices->found_posts); |
|
| 82 | 82 | |
| 83 | - if ( empty( $count ) ) { |
|
| 84 | - $output .= __( 'No Invoice(s)', 'invoicing' ); |
|
| 83 | + if (empty($count)) { |
|
| 84 | + $output .= __('No Invoice(s)', 'invoicing'); |
|
| 85 | 85 | } else { |
| 86 | - $link_url = admin_url( 'edit.php?post_type=wpi_invoice&author=' . absint( $user_id ) ); |
|
| 87 | - $link_text = sprintf( __( 'Invoices ( %d )', 'invoicing' ), $count ); |
|
| 86 | + $link_url = admin_url('edit.php?post_type=wpi_invoice&author=' . absint($user_id)); |
|
| 87 | + $link_text = sprintf(__('Invoices ( %d )', 'invoicing'), $count); |
|
| 88 | 88 | $output .= "<a href='$link_url' >$link_text</a>"; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return apply_filters( 'wpinv_user_invoice_content', $output, $user_id ); |
|
| 91 | + return apply_filters('wpinv_user_invoice_content', $output, $user_id); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | } |