@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays a single fee item in an invoice. |
| 4 | 4 | * |
@@ -9,11 +9,11 @@ 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 | |
| 18 | 18 | <div class='getpaid-invoice-item item-fee border-bottom'> |
| 19 | 19 | |
@@ -25,60 +25,60 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | <?php |
| 27 | 27 | |
| 28 | - // Fires before printing a fee item column. |
|
| 29 | - do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice ); |
|
| 28 | + // Fires before printing a fee item column. |
|
| 29 | + do_action( "getpaid_invoice_fee_item_before_$column", $fee, $invoice ); |
|
| 30 | 30 | |
| 31 | - // Item name. |
|
| 32 | - if ( 'name' == $column ) { |
|
| 31 | + // Item name. |
|
| 32 | + if ( 'name' == $column ) { |
|
| 33 | 33 | |
| 34 | - // Display the name. |
|
| 35 | - echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
| 34 | + // Display the name. |
|
| 35 | + echo '<div class="mb-1">' . esc_html( $fee['name'] ) . '</div>'; |
|
| 36 | 36 | |
| 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>" ); |
|
| 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>" ); |
|
| 40 | 40 | |
| 41 | - } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - // Item price. |
|
| 44 | - if ( 'price' == $column ) { |
|
| 43 | + // Item price. |
|
| 44 | + if ( 'price' == $column ) { |
|
| 45 | 45 | |
| 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() ); |
|
| 49 | - } else { |
|
| 50 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 51 | - } |
|
| 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() ); |
|
| 49 | + } else { |
|
| 50 | + wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 51 | + } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - // Item quantity. |
|
| 55 | - if ( 'quantity' == $column ) { |
|
| 56 | - echo '—'; |
|
| 57 | - } |
|
| 54 | + // Item quantity. |
|
| 55 | + if ( 'quantity' == $column ) { |
|
| 56 | + echo '—'; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - // Item tax. |
|
| 60 | - if ( 'tax_rate' == $column ) { |
|
| 61 | - echo '—'; |
|
| 62 | - } |
|
| 59 | + // Item tax. |
|
| 60 | + if ( 'tax_rate' == $column ) { |
|
| 61 | + echo '—'; |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - // Item sub total. |
|
| 65 | - if ( 'subtotal' == $column ) { |
|
| 64 | + // Item sub total. |
|
| 65 | + if ( 'subtotal' == $column ) { |
|
| 66 | 66 | |
| 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() ); |
|
| 70 | - } else { |
|
| 71 | - wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 72 | - } |
|
| 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() ); |
|
| 70 | + } else { |
|
| 71 | + wpinv_the_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 72 | + } |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - // Fires when printing a fee item column. |
|
| 76 | - do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice ); |
|
| 75 | + // Fires when printing a fee item column. |
|
| 76 | + do_action( "getpaid_invoice_fee_item_$column", $fee, $invoice ); |
|
| 77 | 77 | |
| 78 | - // Fires after printing a fee item column. |
|
| 79 | - do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice ); |
|
| 78 | + // Fires after printing a fee item column. |
|
| 79 | + do_action( "getpaid_invoice_fee_item_after_$column", $fee, $invoice ); |
|
| 80 | 80 | |
| 81 | - ?> |
|
| 81 | + ?> |
|
| 82 | 82 | |
| 83 | 83 | </div> |
| 84 | 84 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays a line items in an invoice. |
| 4 | 4 | * |
@@ -8,11 +8,11 @@ discard block |
||
| 8 | 8 | * @var WPInv_Invoice $invoice |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | + defined( 'ABSPATH' ) || exit; |
|
| 12 | 12 | |
| 13 | -?> |
|
| 14 | - |
|
| 15 | -<?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
| 13 | + ?> |
|
| 14 | + |
|
| 15 | + <?php do_action( 'getpaid_invoice_before_line_items', $invoice ); ?> |
|
| 16 | 16 | |
| 17 | 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"> |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | <div class="getpaid-invoice-items-header <?php echo esc_attr( $invoice->get_template() ); ?>"> |
| 22 | 22 | <div class="form-row row"> |
| 23 | 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 ); ?>"> |
|
| 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 | 25 | <?php echo esc_html( $label ); ?> |
| 26 | - </div> |
|
| 26 | + </div> |
|
| 27 | 27 | <?php endforeach; ?> |
| 28 | 28 | </div> |
| 29 | 29 | </div> |
@@ -31,20 +31,20 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | <?php |
| 33 | 33 | |
| 34 | - // Display the item totals. |
|
| 35 | - foreach ( $invoice->get_items() as $item ) { |
|
| 36 | - wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 37 | - } |
|
| 34 | + // Display the item totals. |
|
| 35 | + foreach ( $invoice->get_items() as $item ) { |
|
| 36 | + wpinv_get_template( 'invoice/line-item.php', compact( 'invoice', 'item', 'columns' ) ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - // Display the fee totals. |
|
| 40 | - foreach ( $invoice->get_fees() as $fee ) { |
|
| 41 | - wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 42 | - } |
|
| 39 | + // Display the fee totals. |
|
| 40 | + foreach ( $invoice->get_fees() as $fee ) { |
|
| 41 | + wpinv_get_template( 'invoice/fee-item.php', compact( 'invoice', 'fee', 'columns' ) ); |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - // Display the cart totals. |
|
| 45 | - wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
| 44 | + // Display the cart totals. |
|
| 45 | + wpinv_get_template( 'invoice/line-totals.php', compact( 'invoice' ) ); |
|
| 46 | 46 | |
| 47 | - ?> |
|
| 47 | + ?> |
|
| 48 | 48 | |
| 49 | 49 | </div> |
| 50 | 50 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays actions on the left side of the invoice header. |
| 4 | 4 | * |
@@ -8,24 +8,24 @@ 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 | 15 | <div class="getpaid-header-left-actions"> |
| 16 | 16 | |
| 17 | 17 | <?php if ( $invoice->is_type( 'invoice' ) && $invoice->needs_payment() && ! $invoice->is_held() ) : ?> |
| 18 | - <a class="btn btn-sm btn-primary m-1 d-inline-block invoice-action-pay" href="<?php echo esc_url( $invoice->get_checkout_payment_url() ); ?>"> |
|
| 18 | + <a class="btn btn-sm btn-primary m-1 d-inline-block invoice-action-pay" href="<?php echo esc_url( $invoice->get_checkout_payment_url() ); ?>"> |
|
| 19 | 19 | <?php esc_html_e( 'Pay For Invoice', 'invoicing' ); ?> |
| 20 | - </a> |
|
| 20 | + </a> |
|
| 21 | 21 | <?php endif; ?> |
| 22 | - |
|
| 22 | + |
|
| 23 | 23 | <?php if ( $invoice->is_type( 'invoice' ) && $invoice->is_paid() ) : ?> |
| 24 | - <a class="btn btn-sm btn-info m-1 d-inline-block invoice-action-receipt" href="<?php echo esc_url( $invoice->get_receipt_url() ); ?>"> |
|
| 24 | + <a class="btn btn-sm btn-info m-1 d-inline-block invoice-action-receipt" href="<?php echo esc_url( $invoice->get_receipt_url() ); ?>"> |
|
| 25 | 25 | <?php esc_html_e( 'View Receipt', 'invoicing' ); ?> |
| 26 | - </a> |
|
| 26 | + </a> |
|
| 27 | 27 | <?php endif; ?> |
| 28 | - |
|
| 28 | + |
|
| 29 | 29 | <?php do_action( 'wpinv_invoice_display_left_actions', $invoice ); ?> |
| 30 | 30 | |
| 31 | 31 | </div> |
@@ -0,0 +1,1 @@ |
||
| 1 | + |
|
| 0 | 2 | \ No newline at end of file |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays a single line item in an invoice. |
| 4 | 4 | * |
@@ -10,11 +10,11 @@ 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 | 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 | |
@@ -26,90 +26,90 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | - // Fires before printing a line item column. |
|
| 30 | - do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice ); |
|
| 29 | + // Fires before printing a line item column. |
|
| 30 | + do_action( "getpaid_invoice_line_item_before_$column", $item, $invoice ); |
|
| 31 | 31 | |
| 32 | - // Item name. |
|
| 33 | - if ( 'name' === $column ) { |
|
| 32 | + // Item name. |
|
| 33 | + if ( 'name' === $column ) { |
|
| 34 | 34 | |
| 35 | - $has_featured_image = has_post_thumbnail( $item->get_id() ); |
|
| 35 | + $has_featured_image = has_post_thumbnail( $item->get_id() ); |
|
| 36 | 36 | |
| 37 | - if ( $has_featured_image ) { |
|
| 38 | - echo '<div class="d-flex align-items-center getpaid-form-item-has-featured-image">'; |
|
| 39 | - echo '<div class="getpaid-form-item-image-container mr-2">'; |
|
| 40 | - echo get_the_post_thumbnail( $item->get_id(), 'thumbnail', array( 'class' => 'getpaid-form-item-image mb-0' ) ); |
|
| 41 | - echo '</div>'; |
|
| 42 | - echo '<div class="getpaid-form-item-name-container">'; |
|
| 43 | - } |
|
| 37 | + if ( $has_featured_image ) { |
|
| 38 | + echo '<div class="d-flex align-items-center getpaid-form-item-has-featured-image">'; |
|
| 39 | + echo '<div class="getpaid-form-item-image-container mr-2">'; |
|
| 40 | + echo get_the_post_thumbnail( $item->get_id(), 'thumbnail', array( 'class' => 'getpaid-form-item-image mb-0' ) ); |
|
| 41 | + echo '</div>'; |
|
| 42 | + echo '<div class="getpaid-form-item-name-container">'; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - // Display the name. |
|
| 46 | - echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 45 | + // Display the name. |
|
| 46 | + echo '<div class="mb-1">' . esc_html( $item->get_name() ) . '</div>'; |
|
| 47 | 47 | |
| 48 | - // And an optional description. |
|
| 49 | - $description = $item->get_description(); |
|
| 48 | + // And an optional description. |
|
| 49 | + $description = $item->get_description(); |
|
| 50 | 50 | |
| 51 | - if ( ! empty( $description ) ) { |
|
| 52 | - echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . '</small>'; |
|
| 53 | - } |
|
| 51 | + if ( ! empty( $description ) ) { |
|
| 52 | + echo "<small class='form-text text-muted pr-2 m-0'>" . wp_kses_post( $description ) . '</small>'; |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - // Fires before printing the line item actions. |
|
| 56 | - do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
| 55 | + // Fires before printing the line item actions. |
|
| 56 | + do_action( 'getpaid_before_invoice_line_item_actions', $item, $invoice ); |
|
| 57 | 57 | |
| 58 | - $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
| 58 | + $actions = apply_filters( 'getpaid-invoice-page-line-item-actions', array(), $item, $invoice ); |
|
| 59 | 59 | |
| 60 | - if ( ! empty( $actions ) ) { |
|
| 60 | + if ( ! empty( $actions ) ) { |
|
| 61 | 61 | |
| 62 | - $sanitized = array(); |
|
| 63 | - foreach ( $actions as $key => $item_action ) { |
|
| 64 | - $key = sanitize_html_class( $key ); |
|
| 65 | - $item_action = wp_kses_post( $item_action ); |
|
| 66 | - $sanitized[] = "<span class='$key'>$item_action</span>"; |
|
| 67 | - } |
|
| 62 | + $sanitized = array(); |
|
| 63 | + foreach ( $actions as $key => $item_action ) { |
|
| 64 | + $key = sanitize_html_class( $key ); |
|
| 65 | + $item_action = wp_kses_post( $item_action ); |
|
| 66 | + $sanitized[] = "<span class='$key'>$item_action</span>"; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - echo "<small class='form-text getpaid-line-item-actions'>"; |
|
| 70 | - echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
| 71 | - echo '</small>'; |
|
| 69 | + echo "<small class='form-text getpaid-line-item-actions'>"; |
|
| 70 | + echo wp_kses_post( implode( ' | ', $sanitized ) ); |
|
| 71 | + echo '</small>'; |
|
| 72 | 72 | |
| 73 | - } |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - if ( $has_featured_image ) { |
|
| 76 | - echo '</div>'; |
|
| 77 | - echo '</div>'; |
|
| 78 | - } |
|
| 79 | - } |
|
| 75 | + if ( $has_featured_image ) { |
|
| 76 | + echo '</div>'; |
|
| 77 | + echo '</div>'; |
|
| 78 | + } |
|
| 79 | + } |
|
| 80 | 80 | |
| 81 | - // Item price. |
|
| 82 | - if ( 'price' === $column ) { |
|
| 81 | + // Item price. |
|
| 82 | + if ( 'price' === $column ) { |
|
| 83 | 83 | |
| 84 | - // Display the item price (or recurring price if this is a renewal invoice) |
|
| 85 | - $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
| 86 | - wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 84 | + // Display the item price (or recurring price if this is a renewal invoice) |
|
| 85 | + $price = $invoice->is_renewal() ? $item->get_price() : $item->get_initial_price(); |
|
| 86 | + wpinv_the_price( $price, $invoice->get_currency() ); |
|
| 87 | 87 | |
| 88 | - } |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - // Tax rate. |
|
| 91 | - if ( 'tax_rate' === $column ) { |
|
| 92 | - echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 93 | - } |
|
| 90 | + // Tax rate. |
|
| 91 | + if ( 'tax_rate' === $column ) { |
|
| 92 | + echo floatval( round( getpaid_get_invoice_tax_rate( $invoice, $item ), 2 ) ) . '%'; |
|
| 93 | + } |
|
| 94 | 94 | |
| 95 | - // Item quantity. |
|
| 96 | - if ( 'quantity' === $column ) { |
|
| 97 | - echo (float) $item->get_quantity(); |
|
| 98 | - } |
|
| 95 | + // Item quantity. |
|
| 96 | + if ( 'quantity' === $column ) { |
|
| 97 | + echo (float) $item->get_quantity(); |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - // Item sub total. |
|
| 101 | - if ( 'subtotal' === $column ) { |
|
| 102 | - $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
| 103 | - wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 104 | - } |
|
| 100 | + // Item sub total. |
|
| 101 | + if ( 'subtotal' === $column ) { |
|
| 102 | + $subtotal = $invoice->is_renewal() ? $item->get_recurring_sub_total() : $item->get_sub_total(); |
|
| 103 | + wpinv_the_price( $subtotal, $invoice->get_currency() ); |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - // Fires when printing a line item column. |
|
| 107 | - do_action( "getpaid_invoice_line_item_$column", $item, $invoice ); |
|
| 106 | + // Fires when printing a line item column. |
|
| 107 | + do_action( "getpaid_invoice_line_item_$column", $item, $invoice ); |
|
| 108 | 108 | |
| 109 | - // Fires after printing a line item column. |
|
| 110 | - do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice ); |
|
| 109 | + // Fires after printing a line item column. |
|
| 110 | + do_action( "getpaid_invoice_line_item_after_$column", $item, $invoice ); |
|
| 111 | 111 | |
| 112 | - ?> |
|
| 112 | + ?> |
|
| 113 | 113 | |
| 114 | 114 | </div> |
| 115 | 115 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays left side of the invoice title. |
| 4 | 4 | * |
@@ -7,24 +7,24 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 11 | 11 | |
| 12 | -$logo_width = wpinv_get_option( 'logo_width' ); |
|
| 13 | -$logo_height = wpinv_get_option( 'logo_height' ); |
|
| 12 | + $logo_width = wpinv_get_option( 'logo_width' ); |
|
| 13 | + $logo_height = wpinv_get_option( 'logo_height' ); |
|
| 14 | 14 | |
| 15 | -?> |
|
| 16 | -<a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 15 | + ?> |
|
| 16 | + <a target="_blank" class="logo-link text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>"> |
|
| 17 | 17 | |
| 18 | 18 | <?php if ( $logo = wpinv_get_business_logo() ) : ?> |
| 19 | - |
|
| 19 | + |
|
| 20 | 20 | <?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?> |
| 21 | - <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 21 | + <img class="logo" style="max-width:100%; width:<?php echo absint( $logo_width ); ?>px; height:<?php echo absint( $logo_height ); ?>px;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 22 | 22 | <?php else : ?> |
| 23 | - <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 23 | + <img class="logo" style="max-width:100%;" src="<?php echo esc_url( $logo ); ?>"> |
|
| 24 | 24 | <?php endif; ?> |
| 25 | - |
|
| 25 | + |
|
| 26 | 26 | <?php else : ?> |
| 27 | - <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 27 | + <h1 class="h3"><?php echo esc_html( wpinv_get_business_name() ); ?></h1> |
|
| 28 | 28 | <?php endif; ?> |
| 29 | 29 | |
| 30 | 30 | </a> |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | /** |
| 3 | 3 | * Displays the invoice details. |
| 4 | 4 | * |
@@ -7,10 +7,10 @@ discard block |
||
| 7 | 7 | * @version 1.0.19 |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | - |
|
| 12 | -?> |
|
| 10 | + defined( 'ABSPATH' ) || exit; |
|
| 13 | 11 | |
| 12 | + ?> |
|
| 13 | + |
|
| 14 | 14 | <?php do_action( 'getpaid_before_invoice_details_main', $invoice ); ?> |
| 15 | 15 | |
| 16 | 16 | <div class="getpaid-invoice-details mt-3 mb-3"> |
@@ -28,5 +28,5 @@ discard block |
||
| 28 | 28 | </div> |
| 29 | 29 | |
| 30 | 30 | <?php do_action( 'getpaid_after_invoice_details_main', $invoice ); ?> |
| 31 | - |
|
| 32 | -<?php |
|
| 31 | + |
|
| 32 | + <?php |
|
@@ -1,69 +1,69 @@ |
||
| 1 | -<?php |
|
| 1 | + <?php |
|
| 2 | 2 | |
| 3 | -if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
| 4 | - exit; |
|
| 3 | + if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
|
| 4 | + exit; |
|
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -global $wpdb; |
|
| 7 | + global $wpdb; |
|
| 8 | 8 | |
| 9 | -if ( get_option( 'wpinv_remove_data_on_invoice_unistall' ) ) { |
|
| 9 | + if ( get_option( 'wpinv_remove_data_on_invoice_unistall' ) ) { |
|
| 10 | 10 | |
| 11 | - // Fetch settings. |
|
| 12 | - $settings = get_option( 'wpinv_settings' ); |
|
| 11 | + // Fetch settings. |
|
| 12 | + $settings = get_option( 'wpinv_settings' ); |
|
| 13 | 13 | |
| 14 | - // Delete pages. |
|
| 15 | - $pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page' ); |
|
| 16 | - foreach ( $pages as $page ) { |
|
| 17 | - if ( is_array( $settings ) && ! empty( $settings[ $page ] ) ) { |
|
| 18 | - wp_delete_post( $settings[ $page ], true ); |
|
| 14 | + // Delete pages. |
|
| 15 | + $pages = array( 'checkout_page', 'success_page', 'failure_page', 'invoice_history_page', 'quote_history_page', 'invoice_subscription_page' ); |
|
| 16 | + foreach ( $pages as $page ) { |
|
| 17 | + if ( is_array( $settings ) && ! empty( $settings[ $page ] ) ) { |
|
| 18 | + wp_delete_post( $settings[ $page ], true ); |
|
| 19 | + } |
|
| 19 | 20 | } |
| 20 | - } |
|
| 21 | 21 | |
| 22 | - // Delete options. |
|
| 23 | - $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv\_%';" ); |
|
| 22 | + // Delete options. |
|
| 23 | + $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wpinv\_%';" ); |
|
| 24 | 24 | |
| 25 | - // Delete posts. |
|
| 26 | - $wpdb->query( |
|
| 27 | - "DELETE a,b |
|
| 25 | + // Delete posts. |
|
| 26 | + $wpdb->query( |
|
| 27 | + "DELETE a,b |
|
| 28 | 28 | FROM {$wpdb->posts} a |
| 29 | 29 | LEFT JOIN {$wpdb->postmeta} b |
| 30 | 30 | ON (a.ID = b.post_id) |
| 31 | 31 | WHERE a.post_type |
| 32 | 32 | IN ( 'wpi_invoice', 'wpi_item', 'wpi_discount', 'wpi_quote' );" |
| 33 | - ); |
|
| 33 | + ); |
|
| 34 | 34 | |
| 35 | - // Delete invoice notes. |
|
| 36 | - $wpdb->query( |
|
| 37 | - "DELETE a,b |
|
| 35 | + // Delete invoice notes. |
|
| 36 | + $wpdb->query( |
|
| 37 | + "DELETE a,b |
|
| 38 | 38 | FROM {$wpdb->comments} a |
| 39 | 39 | LEFT JOIN {$wpdb->commentmeta} b |
| 40 | 40 | ON (a.comment_ID = b.comment_id) |
| 41 | 41 | WHERE a.comment_type = 'wpinv_note'" |
| 42 | - ); |
|
| 42 | + ); |
|
| 43 | 43 | |
| 44 | - // Delete user meta. |
|
| 45 | - $wpdb->query( |
|
| 46 | - "DELETE |
|
| 44 | + // Delete user meta. |
|
| 45 | + $wpdb->query( |
|
| 46 | + "DELETE |
|
| 47 | 47 | FROM {$wpdb->usermeta} |
| 48 | 48 | WHERE meta_key LIKE '%_wpinv_%' OR meta_key LIKE '%_wpi_%';" |
| 49 | - ); |
|
| 49 | + ); |
|
| 50 | 50 | |
| 51 | - // Cleanup Cron Schedule |
|
| 52 | - wp_clear_scheduled_hook( 'wp_session_garbage_collection' ); |
|
| 53 | - wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' ); |
|
| 54 | - wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' ); |
|
| 51 | + // Cleanup Cron Schedule |
|
| 52 | + wp_clear_scheduled_hook( 'wp_session_garbage_collection' ); |
|
| 53 | + wp_clear_scheduled_hook( 'wpinv_register_schedule_event_twicedaily' ); |
|
| 54 | + wp_clear_scheduled_hook( 'wpinv_register_schedule_event_daily' ); |
|
| 55 | 55 | |
| 56 | - // Clear any cached data that has been removed |
|
| 57 | - wp_cache_flush(); |
|
| 56 | + // Clear any cached data that has been removed |
|
| 57 | + wp_cache_flush(); |
|
| 58 | 58 | |
| 59 | - // Delete tables. |
|
| 60 | - $tables = array( |
|
| 61 | - "{$wpdb->prefix}wpinv_subscriptions", |
|
| 62 | - "{$wpdb->prefix}getpaid_invoices", |
|
| 63 | - "{$wpdb->prefix}getpaid_invoice_items", |
|
| 64 | - ); |
|
| 59 | + // Delete tables. |
|
| 60 | + $tables = array( |
|
| 61 | + "{$wpdb->prefix}wpinv_subscriptions", |
|
| 62 | + "{$wpdb->prefix}getpaid_invoices", |
|
| 63 | + "{$wpdb->prefix}getpaid_invoice_items", |
|
| 64 | + ); |
|
| 65 | 65 | |
| 66 | - foreach ( $tables as $table ) { |
|
| 67 | - $wpdb->query( "DROP TABLE IF EXISTS {$table}" ); |
|
| 68 | - } |
|
| 66 | + foreach ( $tables as $table ) { |
|
| 67 | + $wpdb->query( "DROP TABLE IF EXISTS {$table}" ); |
|
| 68 | + } |
|
| 69 | 69 | } |
@@ -0,0 +1,1 @@ |
||
| 1 | + |
|
| 0 | 2 | \ No newline at end of file |