@@ -7,22 +7,22 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | 16 | echo $message_body; |
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 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 | 21 | // Print invoice items. |
| 22 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the billing details. |
| 25 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 26 | 26 | |
| 27 | 27 | // Print the email footer. |
| 28 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -8,18 +8,18 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | -$column_count = count( $columns ); |
|
| 13 | +$column_count = count($columns); |
|
| 14 | 14 | ?> |
| 15 | 15 | |
| 16 | -<?php do_action( 'wpinv_before_email_items', $invoice ); ?> |
|
| 16 | +<?php do_action('wpinv_before_email_items', $invoice); ?> |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | <div id="wpinv-email-items"> |
| 20 | 20 | |
| 21 | 21 | <h3 class="invoice-items-title"> |
| 22 | - <?php echo sprintf( esc_html__( '%s Items', 'invoicing' ), ucfirst( $invoice->get_type() )); ?> |
|
| 22 | + <?php echo sprintf(esc_html__('%s Items', 'invoicing'), ucfirst($invoice->get_type())); ?> |
|
| 23 | 23 | </h3> |
| 24 | 24 | |
| 25 | 25 | <table class="table table-bordered table-hover"> |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | <tr class="wpinv_cart_header_row"> |
| 30 | 30 | |
| 31 | - <?php foreach ( $columns as $key => $label ) : ?> |
|
| 32 | - <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class( $key ); ?>"> |
|
| 33 | - <?php echo sanitize_text_field( $label ); ?> |
|
| 31 | + <?php foreach ($columns as $key => $label) : ?> |
|
| 32 | + <th class="<?php echo 'name' == $key ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class($key); ?>"> |
|
| 33 | + <?php echo sanitize_text_field($label); ?> |
|
| 34 | 34 | </th> |
| 35 | 35 | <?php endforeach; ?> |
| 36 | 36 | |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | <?php |
| 44 | 44 | |
| 45 | 45 | // Display the item totals. |
| 46 | - foreach ( $invoice->get_items() as $item ) { |
|
| 47 | - wpinv_get_template( 'emails/invoice-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 46 | + foreach ($invoice->get_items() as $item) { |
|
| 47 | + wpinv_get_template('emails/invoice-item.php', compact('invoice', 'item', 'columns')); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Display the fee totals. |
| 51 | - foreach ( $invoice->get_fees() as $fee ) { |
|
| 52 | - wpinv_get_template( 'emails/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 51 | + foreach ($invoice->get_fees() as $fee) { |
|
| 52 | + wpinv_get_template('emails/fee-item.php', compact('invoice', 'fee', 'columns')); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | ?> |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | </tbody> |
| 58 | 58 | |
| 59 | 59 | <tfoot> |
| 60 | - <?php wpinv_get_template( 'emails/invoice-totals.php', compact( 'invoice', 'column_count' ) ); ?> |
|
| 60 | + <?php wpinv_get_template('emails/invoice-totals.php', compact('invoice', 'column_count')); ?> |
|
| 61 | 61 | </tfoot> |
| 62 | 62 | |
| 63 | 63 | </table> |
@@ -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 wptexturize( wp_kses_post( str_replace( '{customer_note}', $customer_note, $message_body ) ) ); |
|
| 17 | +echo wptexturize(wp_kses_post(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 ); |
|
| 28 | 27 | \ No newline at end of file |
| 28 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
| 29 | 29 | \ No newline at end of file |
@@ -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 sanitize_html_class( $key ); ?>_row"> |
|
| 36 | + <tr class="wpinv_cart_footer_row wpinv_cart_<?php echo sanitize_html_class($key); ?>_row"> |
|
| 37 | 37 | |
| 38 | - <td colspan="<?php echo ( $column_count - 1 ); ?>" class="wpinv_cart_<?php echo sanitize_html_class( $key ); ?>_label text-right"> |
|
| 39 | - <strong><?php echo sanitize_text_field( $label ); ?>:</strong> |
|
| 38 | + <td colspan="<?php echo ($column_count - 1); ?>" class="wpinv_cart_<?php echo sanitize_html_class($key); ?>_label text-right"> |
|
| 39 | + <strong><?php echo sanitize_text_field($label); ?>:</strong> |
|
| 40 | 40 | </td> |
| 41 | 41 | |
| 42 | - <td class="wpinv_cart_<?php echo sanitize_html_class( $key ); ?> text-right"> |
|
| 42 | + <td class="wpinv_cart_<?php echo sanitize_html_class($key); ?> text-right"> |
|
| 43 | 43 | |
| 44 | 44 | <?php |
| 45 | 45 | |
| 46 | 46 | // Total tax. |
| 47 | - if ( 'tax' == $key ) { |
|
| 48 | - echo wpinv_price( wpinv_format_amount( $invoice->get_total_tax() ), $invoice->get_currency() ); |
|
| 47 | + if ('tax' == $key) { |
|
| 48 | + echo wpinv_price(wpinv_format_amount($invoice->get_total_tax()), $invoice->get_currency()); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if ( 'fee' == $key ) { |
|
| 52 | - echo wpinv_price( wpinv_format_amount( $invoice->get_total_fees() ), $invoice->get_currency() ); |
|
| 51 | + if ('fee' == $key) { |
|
| 52 | + echo wpinv_price(wpinv_format_amount($invoice->get_total_fees()), $invoice->get_currency()); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Total discount. |
| 56 | - if ( 'discount' == $key ) { |
|
| 57 | - echo wpinv_price( wpinv_format_amount( $invoice->get_total_discount() ), $invoice->get_currency() ); |
|
| 56 | + if ('discount' == $key) { |
|
| 57 | + echo wpinv_price(wpinv_format_amount($invoice->get_total_discount()), $invoice->get_currency()); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Sub total. |
| 61 | - if ( 'subtotal' == $key ) { |
|
| 62 | - echo wpinv_price( wpinv_format_amount( $invoice->get_subtotal() ), $invoice->get_currency() ); |
|
| 61 | + if ('subtotal' == $key) { |
|
| 62 | + echo wpinv_price(wpinv_format_amount($invoice->get_subtotal()), $invoice->get_currency()); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Total. |
| 66 | - if ( 'total' == $key ) { |
|
| 67 | - echo wpinv_price( wpinv_format_amount( $invoice->get_total() ), $invoice->get_currency() ); |
|
| 66 | + if ('total' == $key) { |
|
| 67 | + echo wpinv_price(wpinv_format_amount($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,19 +7,19 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | 16 | echo $message_body; |
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 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 | 21 | // Print the billing details. |
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the email footer. |
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -10,67 +10,67 @@ discard block |
||
| 10 | 10 | * @var array $columns |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -defined( 'ABSPATH' ) || exit; |
|
| 13 | +defined('ABSPATH') || exit; |
|
| 14 | 14 | |
| 15 | 15 | ?> |
| 16 | 16 | |
| 17 | -<?php do_action( 'getpaid_before_email_line_item', $invoice, $item ); ?> |
|
| 17 | +<?php do_action('getpaid_before_email_line_item', $invoice, $item); ?> |
|
| 18 | 18 | |
| 19 | -<tr class="wpinv_cart_item item-type-<?php echo sanitize_html_class( $item->get_type() ); ?>"> |
|
| 19 | +<tr class="wpinv_cart_item item-type-<?php echo sanitize_html_class($item->get_type()); ?>"> |
|
| 20 | 20 | |
| 21 | - <?php foreach ( array_keys( $columns ) as $column ): ?> |
|
| 21 | + <?php foreach (array_keys($columns) as $column): ?> |
|
| 22 | 22 | |
| 23 | - <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class( $column ); ?>"> |
|
| 23 | + <td class="<?php echo 'name' == $column ? 'text-left' : 'text-right' ?> wpinv_cart_item_<?php echo sanitize_html_class($column); ?>"> |
|
| 24 | 24 | |
| 25 | 25 | <?php |
| 26 | 26 | |
| 27 | 27 | // Fires before printing a line item column. |
| 28 | - do_action( "getpaid_email_line_item_before_$column", $item, $invoice ); |
|
| 28 | + do_action("getpaid_email_line_item_before_$column", $item, $invoice); |
|
| 29 | 29 | |
| 30 | 30 | // Item name. |
| 31 | - if ( 'name' == $column ) { |
|
| 31 | + if ('name' == $column) { |
|
| 32 | 32 | |
| 33 | 33 | // Display the name. |
| 34 | - echo '<div class="wpinv_email_cart_item_title">' . sanitize_text_field( $item->get_name() ) . '</div>'; |
|
| 34 | + echo '<div class="wpinv_email_cart_item_title">' . sanitize_text_field($item->get_name()) . '</div>'; |
|
| 35 | 35 | |
| 36 | 36 | // And an optional description. |
| 37 | 37 | $description = $item->get_description(); |
| 38 | 38 | |
| 39 | - if ( ! empty( $description ) ) { |
|
| 40 | - $description = wp_kses_post( $description ); |
|
| 39 | + if (!empty($description)) { |
|
| 40 | + $description = wp_kses_post($description); |
|
| 41 | 41 | echo "<p class='small'>$description</p>"; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // Price help text |
| 45 | - $description = getpaid_item_recurring_price_help_text( $item, $currency ); |
|
| 46 | - if ( $description ) { |
|
| 45 | + $description = getpaid_item_recurring_price_help_text($item, $currency); |
|
| 46 | + if ($description) { |
|
| 47 | 47 | echo "<p class='small'>$description</p>"; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Item price. |
| 53 | - if ( 'price' == $column ) { |
|
| 53 | + if ('price' == $column) { |
|
| 54 | 54 | |
| 55 | 55 | // Display the item price (or recurring price if this is a renewal invoice) |
| 56 | 56 | $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
| 57 | - echo wpinv_price( $price ); |
|
| 57 | + echo wpinv_price($price); |
|
| 58 | 58 | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // Item quantity. |
| 62 | - if ( 'quantity' == $column ) { |
|
| 62 | + if ('quantity' == $column) { |
|
| 63 | 63 | echo (int) $item->get_quantity(); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // Item sub total. |
| 67 | - if ( 'subtotal' == $column ) { |
|
| 67 | + if ('subtotal' == $column) { |
|
| 68 | 68 | $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
| 69 | - echo wpinv_price( $subtotal ); |
|
| 69 | + echo wpinv_price($subtotal); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Fires when printing a line item column. |
| 73 | - do_action( "getpaid_email_line_item_$column", $item, $invoice ); |
|
| 73 | + do_action("getpaid_email_line_item_$column", $item, $invoice); |
|
| 74 | 74 | |
| 75 | 75 | ?> |
| 76 | 76 | |
@@ -80,4 +80,4 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | </tr> |
| 82 | 82 | |
| 83 | -<?php do_action( 'getpaid_after_email_line_item', $invoice, $item ); ?> |
|
| 83 | +<?php do_action('getpaid_after_email_line_item', $invoice, $item); ?> |
|
@@ -7,19 +7,19 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | 16 | echo $message_body; |
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 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 | 21 | // Print the billing details. |
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the email footer. |
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -7,19 +7,19 @@ |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | // Print the email header. |
| 13 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 13 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 14 | 14 | |
| 15 | 15 | // Generate the custom message body. |
| 16 | 16 | echo $message_body; |
| 17 | 17 | |
| 18 | 18 | // Print invoice details. |
| 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 | 21 | // Print the billing details. |
| 22 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print the email footer. |
| 25 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -10,58 +10,58 @@ discard block |
||
| 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 sanitize_html_class( $item->get_type() ); ?> border-bottom'> |
|
| 19 | +<div class='getpaid-invoice-item item-<?php echo (int) $item->get_id(); ?> item-type-<?php echo sanitize_html_class($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 sanitize_html_class( $column ); ?>"> |
|
| 25 | + <div class="<?php echo 'name' == $column ? 'col-12 col-sm-6' : 'col-12 col-sm' ?> getpaid-invoice-item-<?php echo sanitize_html_class($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">' . sanitize_text_field( $item->get_name() ) . '</div>'; |
|
| 36 | + echo '<div class="mb-1">' . sanitize_text_field($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 | - $description = wp_kses_post( $description ); |
|
| 41 | + if (!empty($description)) { |
|
| 42 | + $description = wp_kses_post($description); |
|
| 43 | 43 | echo "<small class='form-text text-muted pr-2 m-0'>$description</small>"; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Price help text. |
| 47 | - $description = getpaid_item_recurring_price_help_text( $item, $currency ); |
|
| 48 | - if ( $description ) { |
|
| 47 | + $description = getpaid_item_recurring_price_help_text($item, $currency); |
|
| 48 | + if ($description) { |
|
| 49 | 49 | echo "<small class='form-text text-muted pr-2 m-0'>$description</small>"; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
| 52 | + $actions = apply_filters('getpaid-invoice-page-line-item-actions', array(), $item, $invoice); |
|
| 53 | 53 | |
| 54 | - if ( ! empty( $actions ) ) { |
|
| 54 | + if (!empty($actions)) { |
|
| 55 | 55 | |
| 56 | - $sanitized = array(); |
|
| 57 | - foreach ( $actions as $key => $action ) { |
|
| 58 | - $key = sanitize_html_class( $key ); |
|
| 59 | - $action = wp_kses_post( $action ); |
|
| 56 | + $sanitized = array(); |
|
| 57 | + foreach ($actions as $key => $action) { |
|
| 58 | + $key = sanitize_html_class($key); |
|
| 59 | + $action = wp_kses_post($action); |
|
| 60 | 60 | $sanitized[] = "<span class='$key'>$action</span>"; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | echo "<small class='form-text getpaid-line-item-actions'>"; |
| 64 | - echo implode( ' | ', $sanitized ); |
|
| 64 | + echo implode(' | ', $sanitized); |
|
| 65 | 65 | echo '</small>'; |
| 66 | 66 | |
| 67 | 67 | } |
@@ -69,30 +69,30 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | // Item price. |
| 72 | - if ( 'price' == $column ) { |
|
| 72 | + if ('price' == $column) { |
|
| 73 | 73 | |
| 74 | 74 | // Display the item price (or recurring price if this is a renewal invoice) |
| 75 | 75 | $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
| 76 | - echo wpinv_price( $price ); |
|
| 76 | + echo wpinv_price($price); |
|
| 77 | 77 | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Item quantity. |
| 81 | - if ( 'quantity' == $column ) { |
|
| 81 | + if ('quantity' == $column) { |
|
| 82 | 82 | echo (int) $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 | - echo wpinv_price( $subtotal ); |
|
| 88 | + echo wpinv_price($subtotal); |
|
| 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 | |