@@ -10,63 +10,63 @@ 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_fee_item', $invoice, $fee ); ?> |
|
| 17 | +<?php do_action('getpaid_before_email_fee_item', $invoice, $fee); ?> |
|
| 18 | 18 | |
| 19 | 19 | <tr class="wpinv_cart_item item-fee"> |
| 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 fee item column. |
| 28 | - do_action( "getpaid_email_fee_item_before_$column", $fee, $invoice ); |
|
| 28 | + do_action("getpaid_email_fee_item_before_$column", $fee, $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( $fee['name'] ) . '</div>'; |
|
| 34 | + echo '<div class="wpinv_email_cart_item_title">' . sanitize_text_field($fee['name']) . '</div>'; |
|
| 35 | 35 | |
| 36 | 36 | // And an optional description. |
| 37 | - $description = esc_html__( 'Fee', 'invoicing' ); |
|
| 37 | + $description = esc_html__('Fee', 'invoicing'); |
|
| 38 | 38 | echo "<p class='small'>$description</p>"; |
| 39 | 39 | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Item price. |
| 43 | - if ( 'price' == $column ) { |
|
| 43 | + if ('price' == $column) { |
|
| 44 | 44 | |
| 45 | 45 | // Display the item price (or recurring price if this is a renewal invoice) |
| 46 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 47 | - echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 46 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
| 47 | + echo wpinv_price($fee['recurring_fee'], $invoice->get_currency()); |
|
| 48 | 48 | } else { |
| 49 | - echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 49 | + echo wpinv_price($fee['initial_fee'], $invoice->get_currency()); |
|
| 50 | 50 | } |
| 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 sub total. |
| 60 | - if ( 'subtotal' == $column ) { |
|
| 61 | - if ( $invoice->is_recurring() && $invoice->is_renewal() ) { |
|
| 62 | - echo wpinv_price( $fee['recurring_fee'], $invoice->get_currency() ); |
|
| 60 | + if ('subtotal' == $column) { |
|
| 61 | + if ($invoice->is_recurring() && $invoice->is_renewal()) { |
|
| 62 | + echo wpinv_price($fee['recurring_fee'], $invoice->get_currency()); |
|
| 63 | 63 | } else { |
| 64 | - echo wpinv_price( $fee['initial_fee'], $invoice->get_currency() ); |
|
| 64 | + echo wpinv_price($fee['initial_fee'], $invoice->get_currency()); |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Fires when printing a line item column. |
| 69 | - do_action( "getpaid_email_fee_item_$column", $fee, $invoice ); |
|
| 69 | + do_action("getpaid_email_fee_item_$column", $fee, $invoice); |
|
| 70 | 70 | |
| 71 | 71 | ?> |
| 72 | 72 | |
@@ -76,4 +76,4 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | </tr> |
| 78 | 78 | |
| 79 | -<?php do_action( 'getpaid_after_email_fee_item', $invoice, $fee ); ?> |
|
| 79 | +<?php do_action('getpaid_after_email_fee_item', $invoice, $fee); ?> |
|
@@ -8,18 +8,18 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | 19 | echo $message_body; |
| 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); |
|
@@ -8,24 +8,24 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | 19 | echo $message_body; |
| 20 | 20 | |
| 21 | 21 | // Print invoice details. |
| 22 | -do_action( 'wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin ); |
|
| 22 | +do_action('wpinv_email_invoice_details', $invoice, $email_type, $sent_to_admin); |
|
| 23 | 23 | |
| 24 | 24 | // Print invoice items. |
| 25 | -do_action( 'wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin ); |
|
| 25 | +do_action('wpinv_email_invoice_items', $invoice, $email_type, $sent_to_admin); |
|
| 26 | 26 | |
| 27 | 27 | // Print the billing details. |
| 28 | -do_action( 'wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin ); |
|
| 28 | +do_action('wpinv_email_billing_details', $invoice, $email_type, $sent_to_admin); |
|
| 29 | 29 | |
| 30 | 30 | // Print the email footer. |
| 31 | -do_action( 'wpinv_email_footer', $invoice, $email_type, $sent_to_admin ); |
|
| 31 | +do_action('wpinv_email_footer', $invoice, $email_type, $sent_to_admin); |
|
@@ -8,18 +8,18 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | 19 | echo $message_body; |
| 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); |
|
@@ -8,18 +8,18 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | 19 | echo $message_body; |
| 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); |
|
@@ -8,18 +8,18 @@ |
||
| 8 | 8 | * @var WPInv_Subscription $object |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | $invoice = $object->get_parent_payment(); |
| 14 | 14 | |
| 15 | 15 | // Print the email header. |
| 16 | -do_action( 'wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin ); |
|
| 16 | +do_action('wpinv_email_header', $email_heading, $invoice, $email_type, $sent_to_admin); |
|
| 17 | 17 | |
| 18 | 18 | // Generate the custom message body. |
| 19 | 19 | echo $message_body; |
| 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,55 +7,55 @@ 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 | -} else if ( $invoice->is_refunded() ) { |
|
| 31 | +} else if ($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 | -} else if ( $invoice->is_held() ) { |
|
| 40 | +} else if ($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 | -} else if ( $invoice->needs_payment() ) { |
|
| 49 | +} else if ($invoice->needs_payment()) { |
|
| 50 | 50 | |
| 51 | - if ( $invoice->is_due() ) { |
|
| 51 | + if ($invoice->is_due()) { |
|
| 52 | 52 | |
| 53 | 53 | $alert = aui()->alert( |
| 54 | 54 | array( |
| 55 | 55 | 'type' => 'danger', |
| 56 | 56 | 'content' => sprintf( |
| 57 | - __( 'This invoice was due on %.', 'invoicing' ), |
|
| 58 | - getpaid_format_date_value( $invoice->get_due_date() ) |
|
| 57 | + __('This invoice was due on %.', 'invoicing'), |
|
| 58 | + getpaid_format_date_value($invoice->get_due_date()) |
|
| 59 | 59 | ), |
| 60 | 60 | ) |
| 61 | 61 | ); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $alert = aui()->alert( |
| 66 | 66 | array( |
| 67 | 67 | 'type' => 'warning', |
| 68 | - 'content' => __( 'This invoice needs payment.', 'invoicing' ), |
|
| 68 | + 'content' => __('This invoice needs payment.', 'invoicing'), |
|
| 69 | 69 | ) |
| 70 | 70 | ); |
| 71 | 71 | |
@@ -80,19 +80,19 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | 'pay' => array( |
| 82 | 82 | 'url' => $invoice->get_checkout_payment_url(), |
| 83 | - 'name' => __( 'Pay For Invoice', 'invoicing' ), |
|
| 83 | + 'name' => __('Pay For Invoice', 'invoicing'), |
|
| 84 | 84 | 'class' => 'btn-success', |
| 85 | 85 | ), |
| 86 | 86 | |
| 87 | 87 | 'view' => array( |
| 88 | 88 | 'url' => $invoice->get_view_url(), |
| 89 | - 'name' => __( 'View Invoice', 'invoicing' ), |
|
| 89 | + 'name' => __('View Invoice', 'invoicing'), |
|
| 90 | 90 | 'class' => 'btn-primary', |
| 91 | 91 | ), |
| 92 | 92 | |
| 93 | 93 | 'history' => array( |
| 94 | 94 | 'url' => wpinv_get_history_page_uri(), |
| 95 | - 'name' => __( 'Invoice History', 'invoicing' ), |
|
| 95 | + 'name' => __('Invoice History', 'invoicing'), |
|
| 96 | 96 | 'class' => 'btn-warning', |
| 97 | 97 | ), |
| 98 | 98 | |
@@ -101,12 +101,12 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | -if ( ( ! $invoice->needs_payment() || $invoice->is_held() ) && isset( $actions['pay'] ) ) { |
|
| 105 | - unset( $actions['pay'] ); |
|
| 104 | +if ((!$invoice->needs_payment() || $invoice->is_held()) && isset($actions['pay'])) { |
|
| 105 | + unset($actions['pay']); |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | -if ( ! is_user_logged_in() && isset( $actions['history'] ) ) { |
|
| 109 | - unset( $actions['history'] ); |
|
| 108 | +if (!is_user_logged_in() && isset($actions['history'])) { |
|
| 109 | + unset($actions['history']); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | ?> |
@@ -115,19 +115,19 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | <?php |
| 117 | 117 | |
| 118 | - do_action( 'wpinv_receipt_start', $invoice ); |
|
| 118 | + do_action('wpinv_receipt_start', $invoice); |
|
| 119 | 119 | |
| 120 | - if ( ! empty( $actions ) ) { |
|
| 120 | + if (!empty($actions)) { |
|
| 121 | 121 | |
| 122 | 122 | echo '<div class="wpinv-receipt-actions text-right mt-1 mb-4">'; |
| 123 | 123 | |
| 124 | - foreach ( $actions as $key => $action ) { |
|
| 124 | + foreach ($actions as $key => $action) { |
|
| 125 | 125 | |
| 126 | - $key = sanitize_html_class( $key ); |
|
| 127 | - $class = empty( $action['class'] ) ? 'btn-dark' : sanitize_html_class( $action['class'] ); |
|
| 128 | - $url = empty( $action['url'] ) ? '#' : esc_url( $action['url'] ); |
|
| 129 | - $attrs = empty( $action['attrs'] ) ? '' : $action['attrs']; |
|
| 130 | - $anchor = sanitize_text_field( $action['name'] ); |
|
| 126 | + $key = sanitize_html_class($key); |
|
| 127 | + $class = empty($action['class']) ? 'btn-dark' : sanitize_html_class($action['class']); |
|
| 128 | + $url = empty($action['url']) ? '#' : esc_url($action['url']); |
|
| 129 | + $attrs = empty($action['attrs']) ? '' : $action['attrs']; |
|
| 130 | + $anchor = sanitize_text_field($action['name']); |
|
| 131 | 131 | |
| 132 | 132 | echo "<a href='$url' class='btn btn-sm ml-1 $class $key' $attrs>$anchor</a>"; |
| 133 | 133 | } |
@@ -143,20 +143,20 @@ discard block |
||
| 143 | 143 | <div class="wpinv-receipt-details"> |
| 144 | 144 | |
| 145 | 145 | <h4 class="wpinv-details-t mb-3 mt-3"> |
| 146 | - <?php echo apply_filters( 'wpinv_receipt_details_title', __( 'Invoice Details', 'invoicing' ), $invoice ); ?> |
|
| 146 | + <?php echo apply_filters('wpinv_receipt_details_title', __('Invoice Details', 'invoicing'), $invoice); ?> |
|
| 147 | 147 | </h4> |
| 148 | 148 | |
| 149 | - <?php getpaid_invoice_meta( $invoice ); ?> |
|
| 149 | + <?php getpaid_invoice_meta($invoice); ?> |
|
| 150 | 150 | |
| 151 | 151 | </div> |
| 152 | 152 | |
| 153 | 153 | |
| 154 | - <?php do_action( 'wpinv_receipt_end', $invoice ); ?> |
|
| 154 | + <?php do_action('wpinv_receipt_end', $invoice); ?> |
|
| 155 | 155 | |
| 156 | 156 | </div> |
| 157 | 157 | |
| 158 | 158 | <?php |
| 159 | 159 | |
| 160 | 160 | // @deprecated |
| 161 | -do_action( 'wpinv_success_content_after', $invoice ); |
|
| 162 | -do_action( 'wpinv_after_receipt', $invoice ); |
|
| 161 | +do_action('wpinv_success_content_after', $invoice); |
|
| 162 | +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 | |
@@ -24,40 +24,40 @@ discard block |
||
| 24 | 24 | * @param Array $assoc_args Key value arguments stored in associated array format. |
| 25 | 25 | * @since 1.0.13 |
| 26 | 26 | */ |
| 27 | - public function insert_invoice( $args, $assoc_args ) { |
|
| 27 | + public function insert_invoice($args, $assoc_args) { |
|
| 28 | 28 | |
| 29 | 29 | // Fetch invoice data from the args |
| 30 | - $invoice_data = wp_unslash( $assoc_args ); |
|
| 30 | + $invoice_data = wp_unslash($assoc_args); |
|
| 31 | 31 | |
| 32 | 32 | // Abort if no invoice data is provided |
| 33 | - if( empty( $invoice_data ) ) { |
|
| 34 | - return WP_CLI::error( __( 'Invoice data not provided', 'invoicing' ) ); |
|
| 33 | + if (empty($invoice_data)) { |
|
| 34 | + return WP_CLI::error(__('Invoice data not provided', 'invoicing')); |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | //Cart details |
| 38 | - if( !empty( $invoice_data['cart_details'] ) ) { |
|
| 39 | - $invoice_data['cart_details'] = json_decode( $invoice_data['cart_details'], true ); |
|
| 38 | + if (!empty($invoice_data['cart_details'])) { |
|
| 39 | + $invoice_data['cart_details'] = json_decode($invoice_data['cart_details'], true); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | //User details |
| 43 | - if( !empty( $invoice_data['user_info'] ) ) { |
|
| 44 | - $invoice_data['user_info'] = json_decode( $invoice_data['user_info'], true ); |
|
| 43 | + if (!empty($invoice_data['user_info'])) { |
|
| 44 | + $invoice_data['user_info'] = json_decode($invoice_data['user_info'], true); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | //Payment info |
| 48 | - if( !empty( $invoice_data['payment_details'] ) ) { |
|
| 49 | - $invoice_data['payment_details'] = json_decode( $invoice_data['payment_details'], true ); |
|
| 48 | + if (!empty($invoice_data['payment_details'])) { |
|
| 49 | + $invoice_data['payment_details'] = json_decode($invoice_data['payment_details'], true); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Try creating the invoice |
| 53 | - $invoice = wpinv_insert_invoice( $invoice_data, true ); |
|
| 53 | + $invoice = wpinv_insert_invoice($invoice_data, true); |
|
| 54 | 54 | |
| 55 | - if ( is_wp_error( $invoice ) ) { |
|
| 56 | - return WP_CLI::error( $invoice->get_error_message() ); |
|
| 55 | + if (is_wp_error($invoice)) { |
|
| 56 | + return WP_CLI::error($invoice->get_error_message()); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - $message = sprintf( __( 'Invoice %s created', 'invoicing' ), $invoice->get_id() ); |
|
| 60 | - WP_CLI::success( $message ); |
|
| 59 | + $message = sprintf(__('Invoice %s created', 'invoicing'), $invoice->get_id()); |
|
| 60 | + WP_CLI::success($message); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
@@ -8,23 +8,23 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -defined( 'ABSPATH' ) || exit; |
|
| 11 | +defined('ABSPATH') || exit; |
|
| 12 | 12 | |
| 13 | 13 | ?> |
| 14 | 14 | |
| 15 | 15 | <div class='form-group'> |
| 16 | - <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e( 'Heading', 'invoicing' ) ?></label> |
|
| 16 | + <label :for="active_form_element.id + '_edit_heading'"><?php esc_html_e('Heading', 'invoicing') ?></label> |
|
| 17 | 17 | <input :id="active_form_element.id + '_edit_heading'" v-model='active_form_element.text' class='form-control' type='text' /> |
| 18 | 18 | </div> |
| 19 | 19 | |
| 20 | 20 | <div class='form-group'> |
| 21 | - <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e( 'Select Heading Level', 'invoicing' ) ?></label> |
|
| 21 | + <label :for="active_form_element.id + '_edit_level'"><?php esc_html_e('Select Heading Level', 'invoicing') ?></label> |
|
| 22 | 22 | <select class='form-control custom-select' :id="active_form_element.id + '_edit_level'" v-model='active_form_element.level'> |
| 23 | - <option value='h1'><?php esc_html_e( 'H1', 'invoicing' ); ?></option> |
|
| 24 | - <option value='h2'><?php esc_html_e( 'H2', 'invoicing' ); ?></option> |
|
| 25 | - <option value='h3'><?php esc_html_e( 'H3', 'invoicing' ); ?></option> |
|
| 26 | - <option value='h4'><?php esc_html_e( 'H4', 'invoicing' ); ?></option> |
|
| 27 | - <option value='h5'><?php esc_html_e( 'H5', 'invoicing' ); ?></option> |
|
| 28 | - <option value='h6'><?php esc_html_e( 'H6', 'invoicing' ); ?></option> |
|
| 23 | + <option value='h1'><?php esc_html_e('H1', 'invoicing'); ?></option> |
|
| 24 | + <option value='h2'><?php esc_html_e('H2', 'invoicing'); ?></option> |
|
| 25 | + <option value='h3'><?php esc_html_e('H3', 'invoicing'); ?></option> |
|
| 26 | + <option value='h4'><?php esc_html_e('H4', 'invoicing'); ?></option> |
|
| 27 | + <option value='h5'><?php esc_html_e('H5', 'invoicing'); ?></option> |
|
| 28 | + <option value='h6'><?php esc_html_e('H6', 'invoicing'); ?></option> |
|
| 29 | 29 | </select> |
| 30 | 30 | </div> |