Passed
Push — master ( 039fc1...a932b5 )
by Brian
05:54
created
templates/payment-forms/elements/file_upload.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -7,33 +7,33 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
11
-
12
-$label        = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class  = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14
-$id           = esc_attr( $id );
15
-$_id          = $id . uniqid( '_' );
16
-$max_file_num = empty( $max_file_num ) ? 1 : absint( $max_file_num );
17
-$file_types   = empty( $file_types ) ? array( 'jpg|jpeg|jpe', 'gif', 'png' ) : $file_types;
10
+defined('ABSPATH') || exit;
11
+
12
+$label        = empty($label) ? '' : wp_kses_post($label);
13
+$label_class  = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
14
+$id           = esc_attr($id);
15
+$_id          = $id . uniqid('_');
16
+$max_file_num = empty($max_file_num) ? 1 : absint($max_file_num);
17
+$file_types   = empty($file_types) ? array('jpg|jpeg|jpe', 'gif', 'png') : $file_types;
18 18
 $all_types    = getpaid_get_allowed_mime_types();
19 19
 $types        = array();
20 20
 $_types       = array();
21 21
 
22
-foreach ( $file_types as $file_type ) {
22
+foreach ($file_types as $file_type) {
23 23
 
24
-	if ( isset( $all_types[ $file_type ] ) ) {
25
-		$types[]   = $all_types[ $file_type ];
26
-		$file_type = explode( '|', $file_type );
24
+	if (isset($all_types[$file_type])) {
25
+		$types[]   = $all_types[$file_type];
26
+		$file_type = explode('|', $file_type);
27 27
 
28
-		foreach ( $file_type as $type ) {
29
-			$type     = trim( $type );
28
+		foreach ($file_type as $type) {
29
+			$type     = trim($type);
30 30
 			$types[]  = ".$type";
31 31
 			$_types[] = $type;
32 32
 		}
33 33
 }
34 34
 }
35 35
 
36
-if ( ! empty( $required ) ) {
36
+if (!empty($required)) {
37 37
 	$label .= "<span class='text-danger'> *</span>";
38 38
 }
39 39
 
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
 
42 42
 <label><span v-html="form_element.label"></span></label>
43 43
 
44
-<div class="form-group mb-3 <?php echo esc_attr( $label_class ); ?>" data-name="<?php echo esc_attr( $id ); ?>" data-max="<?php echo esc_attr( $max_file_num ); ?>">
45
-	<label for="<?php echo esc_attr( $id ); ?>"><?php echo wp_kses_post( $label ); ?></label>
46
-	<input type="file" class="sr-only getpaid-files-input" id="<?php echo esc_attr( $id ); ?>" accept="<?php echo esc_attr( implode( ', ', $types ) ); ?>" data-extensions="<?php echo esc_attr( wp_json_encode( $_types ) ); ?>" <?php echo $max_file_num == 1 ? '' : 'multiple="multiple"'; ?>>
44
+<div class="form-group mb-3 <?php echo esc_attr($label_class); ?>" data-name="<?php echo esc_attr($id); ?>" data-max="<?php echo esc_attr($max_file_num); ?>">
45
+	<label for="<?php echo esc_attr($id); ?>"><?php echo wp_kses_post($label); ?></label>
46
+	<input type="file" class="sr-only getpaid-files-input" id="<?php echo esc_attr($id); ?>" accept="<?php echo esc_attr(implode(', ', $types)); ?>" data-extensions="<?php echo esc_attr(wp_json_encode($_types)); ?>" <?php echo $max_file_num == 1 ? '' : 'multiple="multiple"'; ?>>
47 47
 
48
-	<label for="<?php echo esc_attr( $id ); ?>" class="getpaid-file-upload-element d-flex w-100 flex-column align-items-center justify-content-center p-2 mb-2">
48
+	<label for="<?php echo esc_attr($id); ?>" class="getpaid-file-upload-element d-flex w-100 flex-column align-items-center justify-content-center p-2 mb-2">
49 49
 		<div class="h5 text-dark">
50
-			<?php echo esc_html( _n( 'Drag your file to this area or click to upload', 'Drag files to this area or click to upload', $max_file_num, 'invoicing' ) ); ?>
50
+			<?php echo esc_html(_n('Drag your file to this area or click to upload', 'Drag files to this area or click to upload', $max_file_num, 'invoicing')); ?>
51 51
 		</div>
52
-		<?php if ( ! empty( $description ) ) : ?>
53
-			<small class="form-text text-muted"><?php echo wp_kses_post( $description ); ?></small>
52
+		<?php if (!empty($description)) : ?>
53
+			<small class="form-text text-muted"><?php echo wp_kses_post($description); ?></small>
54 54
 		<?php endif; ?>
55 55
 	</label>
56 56
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	<div class="form-row row mb-3 d-none getpaid-progress-template">
60 60
 
61 61
 		<div class="overflow-hidden text-nowrap col-7 col-sm-4">
62
-			<a href="" class="close float-none" title="<?php esc_attr_e( 'Remove File', 'invoicing' ); ?>">&times;<span class="sr-only"><?php esc_html_e( 'Close', 'invoicing' ); ?></span></a>&nbsp;
62
+			<a href="" class="close float-none" title="<?php esc_attr_e('Remove File', 'invoicing'); ?>">&times;<span class="sr-only"><?php esc_html_e('Close', 'invoicing'); ?></span></a>&nbsp;
63 63
 			<i class="fa fa-file" aria-hidden="true"></i>&nbsp; <span class="getpaid-progress-file-name"></span>&nbsp;
64 64
 		</div>
65 65
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/total_payable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,13 +7,13 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-if ( empty( $text ) ) {
13
-    $text = __( 'Total to pay:', 'invoicing' );
12
+if (empty($text)) {
13
+    $text = __('Total to pay:', 'invoicing');
14 14
 }
15 15
 ?>
16 16
 <div class="form-group mb-3 mt-4">
17
-    <strong><?php echo esc_html( $text ); ?></strong>
17
+    <strong><?php echo esc_html($text); ?></strong>
18 18
     <span class="getpaid-checkout-total-payable"></span>
19 19
 </div>
Please login to merge, or discard this patch.
templates/payment-forms/cart.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,34 +7,34 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Cart table columns.
13 13
 $columns = array(
14
-    'name'     => __( 'Item', 'invoicing' ),
15
-    'price'    => __( 'Price', 'invoicing' ),
16
-    'quantity' => __( 'Qty', 'invoicing' ),
17
-    'subtotal' => __( 'Subtotal', 'invoicing' ),
14
+    'name'     => __('Item', 'invoicing'),
15
+    'price'    => __('Price', 'invoicing'),
16
+    'quantity' => __('Qty', 'invoicing'),
17
+    'subtotal' => __('Subtotal', 'invoicing'),
18 18
 );
19 19
 
20
-if ( ! empty( $form->invoice ) ) {
21
-    $columns = getpaid_invoice_item_columns( $form->invoice );
20
+if (!empty($form->invoice)) {
21
+    $columns = getpaid_invoice_item_columns($form->invoice);
22 22
 }
23 23
 
24
-if ( isset( $columns['tax_rate'] ) ) {
25
-    unset( $columns['tax_rate'] );
24
+if (isset($columns['tax_rate'])) {
25
+    unset($columns['tax_rate']);
26 26
 }
27 27
 
28
-$columns = apply_filters( 'getpaid_payment_form_cart_table_columns', $columns, $form );
28
+$columns = apply_filters('getpaid_payment_form_cart_table_columns', $columns, $form);
29 29
 
30 30
 ?>
31 31
     <div class="getpaid-payment-form-items-cart border form-group mb-3">
32 32
 
33 33
         <div class="getpaid-payment-form-items-cart-header font-weight-bold bg-light border-bottom py-2 px-3">
34 34
             <div class="form-row row">
35
-                <?php foreach ( $columns as $key => $label ) : ?>
36
-                    <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo ( in_array( $key, array( 'subtotal', 'quantity', 'tax_rate' ) ) ) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo esc_attr( $key ); ?>">
37
-                        <span><?php echo esc_html( $label ); ?></span>
35
+                <?php foreach ($columns as $key => $label) : ?>
36
+                    <div class="<?php echo 'name' == $key ? 'col-6' : 'col'; ?> <?php echo (in_array($key, array('subtotal', 'quantity', 'tax_rate'))) ? 'd-none d-sm-block' : ''; ?> getpaid-form-cart-item-<?php echo esc_attr($key); ?>">
37
+                        <span><?php echo esc_html($label); ?></span>
38 38
                     </div>
39 39
                 <?php endforeach; ?>
40 40
             </div>
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
         <?php
44 44
 
45 45
             // Display the item totals.
46
-            foreach ( $form->get_items() as $item ) {
47
-			wpinv_get_template( 'payment-forms/cart-item.php', compact( 'form', 'item', 'columns' ) );
46
+            foreach ($form->get_items() as $item) {
47
+			wpinv_get_template('payment-forms/cart-item.php', compact('form', 'item', 'columns'));
48 48
             }
49 49
 
50 50
             // Display the cart totals.
51
-            wpinv_get_template( 'payment-forms/cart-totals.php', compact( 'form' ) );
51
+            wpinv_get_template('payment-forms/cart-totals.php', compact('form'));
52 52
 
53 53
         ?>
54 54
     </div>
55 55
 
56 56
 <?php
57 57
 
58
-do_action( 'getpaid_after_payment_form_cart', $form );
58
+do_action('getpaid_after_payment_form_cart', $form);
Please login to merge, or discard this patch.
templates/payment-forms/variations/checkbox.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,31 +7,31 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Prepare the selectable items.
13 13
 $selectable = array();
14
-foreach ( $form->get_items() as $item ) {
15
-    if ( ! $item->is_required ) {
16
-        $selectable[ $item->get_id() ] = $item->get_name() . ' &mdash; ' . wpinv_price( $item->get_initial_price() );
14
+foreach ($form->get_items() as $item) {
15
+    if (!$item->is_required) {
16
+        $selectable[$item->get_id()] = $item->get_name() . ' &mdash; ' . wpinv_price($item->get_initial_price());
17 17
     }
18 18
 }
19 19
 
20
-if ( empty( $selectable ) ) {
20
+if (empty($selectable)) {
21 21
     return;
22 22
 }
23 23
 
24 24
 echo '<div class="getpaid-payment-form-items-checkbox form-group mb-3">';
25 25
 
26
-foreach ( $selectable as $item_id => $item_name ) {
26
+foreach ($selectable as $item_id => $item_name) {
27 27
 
28
-    $is_checked = get_post_meta( $item_id, 'selected_by_default', true );
28
+    $is_checked = get_post_meta($item_id, 'selected_by_default', true);
29 29
 
30 30
     aui()->input(
31 31
         array(
32 32
             'type'    => 'checkbox',
33 33
             'name'    => 'getpaid-payment-form-selected-item',
34
-            'id'      => 'getpaid-payment-form-selected-item' . uniqid( '_' ) . $item_id,
34
+            'id'      => 'getpaid-payment-form-selected-item' . uniqid('_') . $item_id,
35 35
             'label'   => $item_name,
36 36
             'value'   => $item_id,
37 37
             'no_wrap' => true,
Please login to merge, or discard this patch.
templates/payment-forms-admin/edit/total_payable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 ?>
13 13
 
14 14
 <div class='form-group mb-3'>
15
-    <label :for="active_form_element.id + '_edit'"><?php esc_html_e( 'The total payable text', 'invoicing' ); ?></label>
15
+    <label :for="active_form_element.id + '_edit'"><?php esc_html_e('The total payable text', 'invoicing'); ?></label>
16 16
     <textarea :id="active_form_element.id + '_edit'" v-model='active_form_element.text' class='form-control' rows='3'></textarea>
17 17
 </div>
Please login to merge, or discard this patch.
templates/invoice/company-address.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Prepare the company name.
13
-$company_name = wpinv_get_option( 'vat_company_name' );
13
+$company_name = wpinv_get_option('vat_company_name');
14 14
 
15
-if ( empty( $company_name ) ) {
15
+if (empty($company_name)) {
16 16
     $company_name = wpinv_get_business_name();
17 17
 }
18 18
 
19 19
 // Prepare the VAT number.
20
-$vat_number = wpinv_get_option( 'vat_number' );
20
+$vat_number = wpinv_get_option('vat_number');
21 21
 
22 22
 ?>
23 23
     <div class="getpaid-company-address form-group mb-3">
@@ -25,36 +25,36 @@  discard block
 block discarded – undo
25 25
         <div class="row">
26 26
 
27 27
             <div class="invoice-company-address-label col-2">
28
-                <strong><?php esc_html_e( 'From:', 'invoicing' ); ?></strong>
28
+                <strong><?php esc_html_e('From:', 'invoicing'); ?></strong>
29 29
             </div>
30 30
 
31 31
             <div class="invoice-company-address-value col-10">
32 32
 
33
-                <?php do_action( 'getpaid_company_address_top' ); ?>
33
+                <?php do_action('getpaid_company_address_top'); ?>
34 34
 
35 35
                 <div class="name">
36
-                    <a target="_blank" class="text-dark" href="<?php echo esc_url( wpinv_get_business_website() ); ?>">
37
-                        <?php echo esc_html( $company_name ); ?>
36
+                    <a target="_blank" class="text-dark" href="<?php echo esc_url(wpinv_get_business_website()); ?>">
37
+                        <?php echo esc_html($company_name); ?>
38 38
                     </a>
39 39
                 </div>
40 40
 
41
-                <?php if ( $address = wpinv_get_business_address() ) { ?>
42
-                    <?php echo wp_kses_post( $address ); ?>
41
+                <?php if ($address = wpinv_get_business_address()) { ?>
42
+                    <?php echo wp_kses_post($address); ?>
43 43
                 <?php } ?>
44 44
 
45
-                <?php if ( $email_from = wpinv_mail_get_from_address() ) { ?>
45
+                <?php if ($email_from = wpinv_mail_get_from_address()) { ?>
46 46
                     <div class="email_from">
47
-                        <?php echo wp_sprintf( esc_html__( 'Email: %s', 'invoicing' ), esc_html( $email_from ) ); ?>
47
+                        <?php echo wp_sprintf(esc_html__('Email: %s', 'invoicing'), esc_html($email_from)); ?>
48 48
                     </div>
49 49
                 <?php } ?>
50 50
 
51
-                <?php if ( ! empty( $vat_number ) ) { ?>
51
+                <?php if (!empty($vat_number)) { ?>
52 52
                     <div class="email_from">
53
-                        <?php echo wp_sprintf( esc_html__( 'VAT Number: %s', 'invoicing' ), esc_html( $vat_number ) ); ?>
53
+                        <?php echo wp_sprintf(esc_html__('VAT Number: %s', 'invoicing'), esc_html($vat_number)); ?>
54 54
                     </div>
55 55
                 <?php } ?>
56 56
 
57
-                <?php do_action( 'getpaid_company_address_bottom' ); ?>
57
+                <?php do_action('getpaid_company_address_bottom'); ?>
58 58
 
59 59
             </div>
60 60
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-discount-details.php 1 patch
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,24 +21,24 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the discount.
27
-        $discount = new WPInv_Discount( $post );
27
+        $discount = new WPInv_Discount($post);
28 28
 
29 29
         // Nonce field.
30
-        wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' );
30
+        wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce');
31 31
 
32
-        do_action( 'wpinv_discount_form_top', $discount );
32
+        do_action('wpinv_discount_form_top', $discount);
33 33
 
34 34
         // Set the currency position.
35 35
         $position = wpinv_currency_position();
36 36
 
37
-        if ( $position == 'left_space' ) {
37
+        if ($position == 'left_space') {
38 38
             $position = 'left';
39 39
         }
40 40
 
41
-        if ( $position == 'right_space' ) {
41
+        if ($position == 'right_space') {
42 42
             $position = 'right';
43 43
         }
44 44
 
@@ -52,69 +52,69 @@  discard block
 block discarded – undo
52 52
         </style>
53 53
         <div class='bsui' style='max-width: 600px;padding-top: 10px;'>
54 54
 
55
-            <?php do_action( 'wpinv_discount_form_first', $discount ); ?>
55
+            <?php do_action('wpinv_discount_form_first', $discount); ?>
56 56
 
57
-            <?php do_action( 'wpinv_discount_form_before_code', $discount ); ?>
57
+            <?php do_action('wpinv_discount_form_before_code', $discount); ?>
58 58
 
59 59
             <div class="form-group mb-3 row">
60 60
                 <label for="wpinv_discount_code" class="col-sm-3 col-form-label">
61
-                    <?php esc_html_e( 'Discount Code', 'invoicing' ); ?>
61
+                    <?php esc_html_e('Discount Code', 'invoicing'); ?>
62 62
                 </label>
63 63
                 <div class="col-sm-8">
64 64
                     <div class="row">
65 65
                         <div class="col-sm-12 form-group mb-3">
66
-                            <input type="text" value="<?php echo esc_attr( $discount->get_code( 'edit' ) ); ?>" placeholder="SUMMER_SALE" name="wpinv_discount_code" id="wpinv_discount_code" style="width: 100%;" />
66
+                            <input type="text" value="<?php echo esc_attr($discount->get_code('edit')); ?>" placeholder="SUMMER_SALE" name="wpinv_discount_code" id="wpinv_discount_code" style="width: 100%;" />
67 67
                         </div>
68 68
                         <div class="col-sm-12">
69 69
                             <?php
70
-                                do_action( 'wpinv_discount_form_before_single_use', $discount );
70
+                                do_action('wpinv_discount_form_before_single_use', $discount);
71 71
 
72 72
                                 aui()->input(
73 73
                                     array(
74 74
                                         'id'      => 'wpinv_discount_single_use',
75 75
                                         'name'    => 'wpinv_discount_single_use',
76 76
                                         'type'    => 'checkbox',
77
-                                        'label'   => __( 'Each customer can only use this discount once', 'invoicing' ),
77
+                                        'label'   => __('Each customer can only use this discount once', 'invoicing'),
78 78
                                         'value'   => '1',
79 79
                                         'checked' => $discount->is_single_use(),
80 80
                                     ),
81 81
                                     true
82 82
                                 );
83 83
 
84
-                                do_action( 'wpinv_discount_form_single_use', $discount );
84
+                                do_action('wpinv_discount_form_single_use', $discount);
85 85
                             ?>
86 86
                         </div>
87 87
                         <div class="col-sm-12">
88 88
                             <?php
89
-                                do_action( 'wpinv_discount_form_before_recurring', $discount );
89
+                                do_action('wpinv_discount_form_before_recurring', $discount);
90 90
 
91 91
                                 aui()->input(
92 92
                                     array(
93 93
                                         'id'      => 'wpinv_discount_recurring',
94 94
                                         'name'    => 'wpinv_discount_recurring',
95 95
                                         'type'    => 'checkbox',
96
-                                        'label'   => __( 'Apply this discount to all recurring payments for subscriptions', 'invoicing' ),
96
+                                        'label'   => __('Apply this discount to all recurring payments for subscriptions', 'invoicing'),
97 97
                                         'value'   => '1',
98 98
                                         'checked' => $discount->is_recurring(),
99 99
                                     ),
100 100
                                     true
101 101
                                 );
102 102
 
103
-                                do_action( 'wpinv_discount_form_recurring', $discount );
103
+                                do_action('wpinv_discount_form_recurring', $discount);
104 104
                             ?>
105 105
                         </div>
106 106
                     </div>
107 107
                 </div>
108 108
                 <div class="col-sm-1 pt-2 pl-0">
109
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter a discount code such as 10OFF.', 'invoicing' ); ?>"></span>
109
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter a discount code such as 10OFF.', 'invoicing'); ?>"></span>
110 110
                 </div>
111 111
             </div>
112
-            <?php do_action( 'wpinv_discount_form_code', $discount ); ?>
112
+            <?php do_action('wpinv_discount_form_code', $discount); ?>
113 113
 
114
-            <?php do_action( 'wpinv_discount_form_before_type', $discount ); ?>
114
+            <?php do_action('wpinv_discount_form_before_type', $discount); ?>
115 115
             <div class="form-group mb-3 row">
116 116
                 <label for="wpinv_discount_type" class="col-sm-3 col-form-label">
117
-                    <?php esc_html_e( 'Discount Type', 'invoicing' ); ?>
117
+                    <?php esc_html_e('Discount Type', 'invoicing'); ?>
118 118
                 </label>
119 119
                 <div class="col-sm-8">
120 120
                     <?php
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
                             array(
123 123
                                 'id'               => 'wpinv_discount_type',
124 124
                                 'name'             => 'wpinv_discount_type',
125
-                                'label'            => __( 'Discount Type', 'invoicing' ),
126
-                                'placeholder'      => __( 'Select Discount Type', 'invoicing' ),
127
-                                'value'            => $discount->get_type( 'edit' ),
125
+                                'label'            => __('Discount Type', 'invoicing'),
126
+                                'placeholder'      => __('Select Discount Type', 'invoicing'),
127
+                                'value'            => $discount->get_type('edit'),
128 128
                                 'select2'          => true,
129 129
                                 'data-allow-clear' => 'false',
130 130
                                 'options'          => wpinv_get_discount_types(),
@@ -134,49 +134,49 @@  discard block
 block discarded – undo
134 134
                     ?>
135 135
                 </div>
136 136
                 <div class="col-sm-1 pt-2 pl-0">
137
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Discount type.', 'invoicing' ); ?>"></span>
137
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Discount type.', 'invoicing'); ?>"></span>
138 138
                 </div>
139 139
             </div>
140
-            <?php do_action( 'wpinv_discount_form_type', $discount ); ?>
140
+            <?php do_action('wpinv_discount_form_type', $discount); ?>
141 141
 
142
-            <?php do_action( 'wpinv_discount_form_before_amount', $discount ); ?>
143
-            <div class="form-group mb-3 row <?php echo esc_attr( $discount->get_type( 'edit' ) ); ?>" id="wpinv_discount_amount_wrap">
142
+            <?php do_action('wpinv_discount_form_before_amount', $discount); ?>
143
+            <div class="form-group mb-3 row <?php echo esc_attr($discount->get_type('edit')); ?>" id="wpinv_discount_amount_wrap">
144 144
                 <label for="wpinv_discount_amount" class="col-sm-3 col-form-label">
145
-                    <?php esc_html_e( 'Discount Amount', 'invoicing' ); ?>
145
+                    <?php esc_html_e('Discount Amount', 'invoicing'); ?>
146 146
                 </label>
147 147
                 <div class="col-sm-8">
148 148
                     <div class="input-group input-group-sm">
149 149
 
150
-                        <?php if ( 'left' == $position ) : ?>
151
-                            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
150
+                        <?php if ('left' == $position) : ?>
151
+                            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
152 152
                                 <div class="input-group-prepend left wpinv-if-flat">
153 153
                                     <span class="input-group-text">
154
-                                        <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
154
+                                        <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
155 155
                                     </span>
156 156
                                 </div>
157 157
                             <?php else : ?>
158 158
                                 <span class="input-group-text left wpinv-if-flat">
159
-                                    <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
159
+                                    <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
160 160
                                 </span>
161 161
                             <?php endif; ?>
162 162
                         <?php endif; ?>
163 163
 
164
-                        <input type="text" name="wpinv_discount_amount" id="wpinv_discount_amount" value="<?php echo esc_attr( $discount->get_amount( 'edit' ) ); ?>" placeholder="0" class="form-control">
164
+                        <input type="text" name="wpinv_discount_amount" id="wpinv_discount_amount" value="<?php echo esc_attr($discount->get_amount('edit')); ?>" placeholder="0" class="form-control">
165 165
 
166
-                        <?php if ( 'right' == $position ) : ?>
167
-                            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
166
+                        <?php if ('right' == $position) : ?>
167
+                            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
168 168
                                 <div class="input-group-append right wpinv-if-flat">
169 169
                                     <span class="input-group-text">
170
-                                        <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
170
+                                        <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
171 171
                                     </span>
172 172
                                 </div>
173 173
                             <?php else : ?>
174 174
                                 <span class="input-group-text left wpinv-if-flat">
175
-                                    <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
175
+                                    <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
176 176
                                 </span>
177 177
                             <?php endif; ?>
178 178
                         <?php endif; ?>
179
-                        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
179
+                        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
180 180
                             <div class="input-group-append right wpinv-if-percent">
181 181
                                 <span class="input-group-text">%</span>
182 182
                             </div>
@@ -186,15 +186,15 @@  discard block
 block discarded – undo
186 186
                     </div>
187 187
                 </div>
188 188
                 <div class="col-sm-1 pt-2 pl-0">
189
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter the discount value. Ex: 10', 'invoicing' ); ?>"></span>
189
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter the discount value. Ex: 10', 'invoicing'); ?>"></span>
190 190
                 </div>
191 191
             </div>
192
-            <?php do_action( 'wpinv_discount_form_amount', $discount ); ?>
192
+            <?php do_action('wpinv_discount_form_amount', $discount); ?>
193 193
 
194
-            <?php do_action( 'wpinv_discount_form_before_items', $discount ); ?>
194
+            <?php do_action('wpinv_discount_form_before_items', $discount); ?>
195 195
             <div class="form-group mb-3 row">
196 196
                 <label for="wpinv_discount_items" class="col-sm-3 col-form-label">
197
-                    <?php esc_html_e( 'Items', 'invoicing' ); ?>
197
+                    <?php esc_html_e('Items', 'invoicing'); ?>
198 198
                 </label>
199 199
                 <div class="col-sm-8">
200 200
                     <?php
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
                             array(
203 203
                                 'id'               => 'wpinv_discount_items',
204 204
                                 'name'             => 'wpinv_discount_items[]',
205
-                                'label'            => __( 'Items', 'invoicing' ),
206
-                                'placeholder'      => __( 'Select Items', 'invoicing' ),
207
-                                'value'            => $discount->get_items( 'edit' ),
205
+                                'label'            => __('Items', 'invoicing'),
206
+                                'placeholder'      => __('Select Items', 'invoicing'),
207
+                                'value'            => $discount->get_items('edit'),
208 208
                                 'select2'          => true,
209 209
                                 'multiple'         => true,
210 210
                                 'data-allow-clear' => 'false',
@@ -215,15 +215,15 @@  discard block
 block discarded – undo
215 215
                     ?>
216 216
                 </div>
217 217
                 <div class="col-sm-1 pt-2 pl-0">
218
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Select the items that are allowed to use this discount or leave blank to use this discount all items.', 'invoicing' ); ?>"></span>
218
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Select the items that are allowed to use this discount or leave blank to use this discount all items.', 'invoicing'); ?>"></span>
219 219
                 </div>
220 220
             </div>
221
-            <?php do_action( 'wpinv_discount_form_items', $discount ); ?>
221
+            <?php do_action('wpinv_discount_form_items', $discount); ?>
222 222
 
223
-            <?php do_action( 'wpinv_discount_form_before_excluded_items', $discount ); ?>
223
+            <?php do_action('wpinv_discount_form_before_excluded_items', $discount); ?>
224 224
             <div class="form-group mb-3 row">
225 225
                 <label for="wpinv_discount_excluded_items" class="col-sm-3 col-form-label">
226
-                    <?php esc_html_e( 'Excluded Items', 'invoicing' ); ?>
226
+                    <?php esc_html_e('Excluded Items', 'invoicing'); ?>
227 227
                 </label>
228 228
                 <div class="col-sm-8">
229 229
                     <?php
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
                             array(
232 232
                                 'id'               => 'wpinv_discount_excluded_items',
233 233
                                 'name'             => 'wpinv_discount_excluded_items[]',
234
-                                'label'            => __( 'Excluded Items', 'invoicing' ),
235
-                                'placeholder'      => __( 'Select Items', 'invoicing' ),
236
-                                'value'            => $discount->get_excluded_items( 'edit' ),
234
+                                'label'            => __('Excluded Items', 'invoicing'),
235
+                                'placeholder'      => __('Select Items', 'invoicing'),
236
+                                'value'            => $discount->get_excluded_items('edit'),
237 237
                                 'select2'          => true,
238 238
                                 'multiple'         => true,
239 239
                                 'data-allow-clear' => 'false',
@@ -244,15 +244,15 @@  discard block
 block discarded – undo
244 244
                     ?>
245 245
                 </div>
246 246
                 <div class="col-sm-1 pt-2 pl-0">
247
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Select all the items that are not allowed to use this discount.', 'invoicing' ); ?>"></span>
247
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Select all the items that are not allowed to use this discount.', 'invoicing'); ?>"></span>
248 248
                 </div>
249 249
             </div>
250
-            <?php do_action( 'wpinv_discount_form_excluded_items', $discount ); ?>
250
+            <?php do_action('wpinv_discount_form_excluded_items', $discount); ?>
251 251
 
252
-            <?php do_action( 'wpinv_discount_form_before_required_items', $discount ); ?>
252
+            <?php do_action('wpinv_discount_form_before_required_items', $discount); ?>
253 253
             <div class="form-group mb-3 row">
254 254
                 <label for="wpinv_discount_required_items" class="col-sm-3 col-form-label">
255
-                    <?php esc_html_e( 'Required Items', 'invoicing' ); ?>
255
+                    <?php esc_html_e('Required Items', 'invoicing'); ?>
256 256
                 </label>
257 257
                 <div class="col-sm-8">
258 258
                     <?php
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
                             array(
261 261
                                 'id'               => 'wpinv_discount_required_items',
262 262
                                 'name'             => 'wpinv_discount_required_items[]',
263
-                                'label'            => __( 'Required Items', 'invoicing' ),
264
-                                'placeholder'      => __( 'Select Items', 'invoicing' ),
265
-                                'value'            => $discount->get_required_items( 'edit' ),
263
+                                'label'            => __('Required Items', 'invoicing'),
264
+                                'placeholder'      => __('Select Items', 'invoicing'),
265
+                                'value'            => $discount->get_required_items('edit'),
266 266
                                 'select2'          => true,
267 267
                                 'multiple'         => true,
268 268
                                 'data-allow-clear' => 'false',
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
                     ?>
274 274
                 </div>
275 275
                 <div class="col-sm-1 pt-2 pl-0">
276
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Select all the items that are required to be in the cart before using this discount.', 'invoicing' ); ?>"></span>
276
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Select all the items that are required to be in the cart before using this discount.', 'invoicing'); ?>"></span>
277 277
                 </div>
278 278
             </div>
279
-            <?php do_action( 'wpinv_discount_form_required_items', $discount ); ?>
279
+            <?php do_action('wpinv_discount_form_required_items', $discount); ?>
280 280
 
281
-            <?php do_action( 'wpinv_discount_form_before_start', $discount ); ?>
281
+            <?php do_action('wpinv_discount_form_before_start', $discount); ?>
282 282
             <div class="form-group mb-3 row">
283 283
                 <label for="wpinv_discount_start" class="col-sm-3 col-form-label">
284
-                    <?php esc_html_e( 'Start Date', 'invoicing' ); ?>
284
+                    <?php esc_html_e('Start Date', 'invoicing'); ?>
285 285
                 </label>
286 286
                 <div class="col-sm-8">
287 287
                     <?php
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
                                 'type'             => 'datepicker',
291 291
                                 'id'               => 'wpinv_discount_start',
292 292
                                 'name'             => 'wpinv_discount_start',
293
-                                'label'            => __( 'Start Date', 'invoicing' ),
293
+                                'label'            => __('Start Date', 'invoicing'),
294 294
                                 'placeholder'      => 'YYYY-MM-DD 00:00',
295 295
                                 'class'            => 'form-control-sm',
296
-                                'value'            => $discount->get_start_date( 'edit' ),
296
+                                'value'            => $discount->get_start_date('edit'),
297 297
                                 'extra_attributes' => array(
298 298
                                     'data-enable-time' => 'true',
299 299
                                     'data-time_24hr'   => 'true',
@@ -305,15 +305,15 @@  discard block
 block discarded – undo
305 305
                     ?>
306 306
                 </div>
307 307
                 <div class="col-sm-1 pt-2 pl-0">
308
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'For no start date, leave blank. If entered, the discount can only be used after or on this date.', 'invoicing' ); ?>"></span>
308
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('For no start date, leave blank. If entered, the discount can only be used after or on this date.', 'invoicing'); ?>"></span>
309 309
                 </div>
310 310
             </div>
311
-            <?php do_action( 'wpinv_discount_form_start', $discount ); ?>
311
+            <?php do_action('wpinv_discount_form_start', $discount); ?>
312 312
 
313
-            <?php do_action( 'wpinv_discount_form_before_expiration', $discount ); ?>
313
+            <?php do_action('wpinv_discount_form_before_expiration', $discount); ?>
314 314
             <div class="form-group mb-3 row">
315 315
                 <label for="wpinv_discount_expiration" class="col-sm-3 col-form-label">
316
-                    <?php esc_html_e( 'Expiration Date', 'invoicing' ); ?>
316
+                    <?php esc_html_e('Expiration Date', 'invoicing'); ?>
317 317
                 </label>
318 318
                 <div class="col-sm-8">
319 319
                     <?php
@@ -322,10 +322,10 @@  discard block
 block discarded – undo
322 322
                                 'type'             => 'datepicker',
323 323
                                 'id'               => 'wpinv_discount_expiration',
324 324
                                 'name'             => 'wpinv_discount_expiration',
325
-                                'label'            => __( 'Expiration Date', 'invoicing' ),
325
+                                'label'            => __('Expiration Date', 'invoicing'),
326 326
                                 'placeholder'      => 'YYYY-MM-DD 00:00',
327 327
                                 'class'            => 'form-control-sm',
328
-                                'value'            => $discount->get_end_date( 'edit' ),
328
+                                'value'            => $discount->get_end_date('edit'),
329 329
                                 'extra_attributes' => array(
330 330
                                     'data-enable-time' => 'true',
331 331
                                     'data-time_24hr'   => 'true',
@@ -339,111 +339,111 @@  discard block
 block discarded – undo
339 339
                     ?>
340 340
                 </div>
341 341
                 <div class="col-sm-1 pt-2 pl-0">
342
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the date after which the discount will expire.', 'invoicing' ); ?>"></span>
342
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the date after which the discount will expire.', 'invoicing'); ?>"></span>
343 343
                 </div>
344 344
             </div>
345
-            <?php do_action( 'wpinv_discount_form_expiration', $discount ); ?>
345
+            <?php do_action('wpinv_discount_form_expiration', $discount); ?>
346 346
 
347
-            <?php do_action( 'wpinv_discount_form_before_min_total', $discount ); ?>
347
+            <?php do_action('wpinv_discount_form_before_min_total', $discount); ?>
348 348
             <div class="form-group mb-3 row">
349 349
                 <label for="wpinv_discount_min_total" class="col-sm-3 col-form-label">
350
-                    <?php esc_html_e( 'Minimum Amount', 'invoicing' ); ?>
350
+                    <?php esc_html_e('Minimum Amount', 'invoicing'); ?>
351 351
                 </label>
352 352
                 <div class="col-sm-8">
353 353
                     <div class="input-group input-group-sm">
354 354
 
355
-                        <?php if ( 'left' == $position ) : ?>
356
-                            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
355
+                        <?php if ('left' == $position) : ?>
356
+                            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
357 357
                                 <div class="input-group-prepend">
358
-                                    <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
358
+                                    <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
359 359
                                 </div>
360 360
                             <?php else : ?>
361 361
                                 <span class="input-group-text">
362
-                                    <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
362
+                                    <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
363 363
                                 </span>
364 364
                             <?php endif; ?>
365 365
                         <?php endif; ?>
366 366
 
367
-                        <input type="text" name="wpinv_discount_min_total" id="wpinv_discount_min_total" value="<?php echo esc_attr( $discount->get_minimum_total( 'edit' ) ); ?>" placeholder="<?php esc_attr_e( 'No minimum', 'invoicing' ); ?>" class="form-control">
367
+                        <input type="text" name="wpinv_discount_min_total" id="wpinv_discount_min_total" value="<?php echo esc_attr($discount->get_minimum_total('edit')); ?>" placeholder="<?php esc_attr_e('No minimum', 'invoicing'); ?>" class="form-control">
368 368
 
369
-                        <?php if ( 'left' != $position ) : ?>
370
-                            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
369
+                        <?php if ('left' != $position) : ?>
370
+                            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
371 371
                                 <div class="input-group-append">
372
-                                    <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
372
+                                    <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
373 373
                                 </div>
374 374
                             <?php else : ?>
375 375
                                 <span class="input-group-text">
376
-                                    <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
376
+                                    <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
377 377
                                 </span>
378 378
                             <?php endif; ?>
379 379
                         <?php endif; ?>
380 380
                     </div>
381 381
                 </div>
382 382
                 <div class="col-sm-1 pt-2 pl-0">
383
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the minimum amount (including taxes) required to use this discount.', 'invoicing' ); ?>"></span>
383
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the minimum amount (including taxes) required to use this discount.', 'invoicing'); ?>"></span>
384 384
                 </div>
385 385
             </div>
386
-            <?php do_action( 'wpinv_discount_form_min_total', $discount ); ?>
386
+            <?php do_action('wpinv_discount_form_min_total', $discount); ?>
387 387
 
388
-            <?php do_action( 'wpinv_discount_form_before_max_total', $discount ); ?>
388
+            <?php do_action('wpinv_discount_form_before_max_total', $discount); ?>
389 389
             <div class="form-group mb-3 row">
390 390
                 <label for="wpinv_discount_max_total" class="col-sm-3 col-form-label">
391
-                    <?php esc_html_e( 'Maximum Amount', 'invoicing' ); ?>
391
+                    <?php esc_html_e('Maximum Amount', 'invoicing'); ?>
392 392
                 </label>
393 393
                 <div class="col-sm-8">
394 394
                     <div class="input-group input-group-sm">
395
-                        <?php if ( 'left' == $position ) : ?>
396
-                            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
395
+                        <?php if ('left' == $position) : ?>
396
+                            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
397 397
                                 <div class="input-group-prepend">
398
-                                    <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
398
+                                    <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
399 399
                                 </div>
400 400
                             <?php else : ?>
401 401
                                 <span class="input-group-text">
402
-                                    <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
402
+                                    <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
403 403
                                 </span>
404 404
                             <?php endif; ?>
405 405
                         <?php endif; ?>
406 406
 
407
-                        <input type="text" name="wpinv_discount_max_total" id="wpinv_discount_max_total" value="<?php echo esc_attr( $discount->get_maximum_total( 'edit' ) ); ?>" placeholder="<?php esc_attr_e( 'No maximum', 'invoicing' ); ?>" class="form-control">
407
+                        <input type="text" name="wpinv_discount_max_total" id="wpinv_discount_max_total" value="<?php echo esc_attr($discount->get_maximum_total('edit')); ?>" placeholder="<?php esc_attr_e('No maximum', 'invoicing'); ?>" class="form-control">
408 408
 
409
-                        <?php if ( 'left' != $position ) : ?>
410
-                            <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
409
+                        <?php if ('left' != $position) : ?>
410
+                            <?php if (empty($GLOBALS['aui_bs5'])) : ?>
411 411
                                 <div class="input-group-append">
412
-                                    <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
412
+                                    <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
413 413
                                 </div>
414 414
                             <?php else : ?>
415 415
                                 <span class="input-group-text">
416
-                                    <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
416
+                                    <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
417 417
                                 </span>
418 418
                             <?php endif; ?>
419 419
                         <?php endif; ?>
420 420
                     </div>
421 421
                 </div>
422 422
                 <div class="col-sm-1 pt-2 pl-0">
423
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the maximum amount (including taxes) allowed when using this discount.', 'invoicing' ); ?>"></span>
423
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the maximum amount (including taxes) allowed when using this discount.', 'invoicing'); ?>"></span>
424 424
                 </div>
425 425
             </div>
426
-            <?php do_action( 'wpinv_discount_form_before_max_total', $discount ); ?>
426
+            <?php do_action('wpinv_discount_form_before_max_total', $discount); ?>
427 427
 
428
-            <?php do_action( 'wpinv_discount_form_before_max_uses', $discount ); ?>
428
+            <?php do_action('wpinv_discount_form_before_max_uses', $discount); ?>
429 429
             <div class="form-group mb-3 row">
430 430
                 <label for="wpinv_discount_max_uses" class="col-sm-3 col-form-label">
431
-                    <?php esc_html_e( 'Maximum Uses', 'invoicing' ); ?>
431
+                    <?php esc_html_e('Maximum Uses', 'invoicing'); ?>
432 432
                 </label>
433 433
                 <div class="col-sm-8">
434
-                    <input type="text" value="<?php echo esc_attr( $discount->get_max_uses( 'edit' ) ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'invoicing' ); ?>" name="wpinv_discount_max_uses" id="wpinv_discount_max_uses" style="width: 100%;" />
434
+                    <input type="text" value="<?php echo esc_attr($discount->get_max_uses('edit')); ?>" placeholder="<?php esc_attr_e('Unlimited', 'invoicing'); ?>" name="wpinv_discount_max_uses" id="wpinv_discount_max_uses" style="width: 100%;" />
435 435
                 </div>
436 436
                 <div class="col-sm-1 pt-2 pl-0">
437
-                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Optionally set the maximum number of times that this discount code can be used.', 'invoicing' ); ?>"></span>
437
+                    <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Optionally set the maximum number of times that this discount code can be used.', 'invoicing'); ?>"></span>
438 438
                 </div>
439 439
             </div>
440
-            <?php do_action( 'wpinv_discount_form_max_uses', $discount ); ?>
440
+            <?php do_action('wpinv_discount_form_max_uses', $discount); ?>
441 441
 
442
-            <?php do_action( 'wpinv_discount_form_last', $discount ); ?>
442
+            <?php do_action('wpinv_discount_form_last', $discount); ?>
443 443
 
444 444
         </div>
445 445
         <?php
446
-        do_action( 'wpinv_discount_form_bottom', $post );
446
+        do_action('wpinv_discount_form_bottom', $post);
447 447
     }
448 448
 
449 449
     /**
@@ -451,31 +451,31 @@  discard block
 block discarded – undo
451 451
 	 *
452 452
 	 * @param int $post_id
453 453
 	 */
454
-	public static function save( $post_id ) {
454
+	public static function save($post_id) {
455 455
 
456 456
         // Prepare the discount.
457
-        $discount = new WPInv_Discount( $post_id );
457
+        $discount = new WPInv_Discount($post_id);
458 458
 
459 459
         // Load new data.
460 460
         $discount->set_props(
461 461
 			array(
462
-				'code'           => isset( $_POST['wpinv_discount_code'] ) ? wpinv_clean( $_POST['wpinv_discount_code'] ) : null,
463
-				'amount'         => isset( $_POST['wpinv_discount_amount'] ) ? floatval( $_POST['wpinv_discount_amount'] ) : null,
464
-				'start'          => isset( $_POST['wpinv_discount_start'] ) ? wpinv_clean( $_POST['wpinv_discount_start'] ) : null,
465
-				'expiration'     => isset( $_POST['wpinv_discount_expiration'] ) ? wpinv_clean( $_POST['wpinv_discount_expiration'] ) : null,
466
-				'is_single_use'  => ! empty( $_POST['wpinv_discount_single_use'] ),
467
-                'type'           => isset( $_POST['wpinv_discount_type'] ) ? wpinv_clean( $_POST['wpinv_discount_type'] ) : null,
468
-				'is_recurring'   => ! empty( $_POST['wpinv_discount_recurring'] ),
469
-				'items'          => isset( $_POST['wpinv_discount_items'] ) ? wpinv_clean( $_POST['wpinv_discount_items'] ) : array(),
470
-				'excluded_items' => isset( $_POST['wpinv_discount_excluded_items'] ) ? wpinv_clean( $_POST['wpinv_discount_excluded_items'] ) : array(),
471
-                'required_items' => isset( $_POST['wpinv_discount_required_items'] ) ? wpinv_clean( $_POST['wpinv_discount_required_items'] ) : array(),
472
-				'max_uses'       => isset( $_POST['wpinv_discount_max_uses'] ) ? intval( $_POST['wpinv_discount_max_uses'] ) : null,
473
-				'min_total'      => isset( $_POST['wpinv_discount_min_total'] ) ? floatval( $_POST['wpinv_discount_min_total'] ) : null,
474
-				'max_total'      => isset( $_POST['wpinv_discount_max_total'] ) ? floatval( $_POST['wpinv_discount_max_total'] ) : null,
462
+				'code'           => isset($_POST['wpinv_discount_code']) ? wpinv_clean($_POST['wpinv_discount_code']) : null,
463
+				'amount'         => isset($_POST['wpinv_discount_amount']) ? floatval($_POST['wpinv_discount_amount']) : null,
464
+				'start'          => isset($_POST['wpinv_discount_start']) ? wpinv_clean($_POST['wpinv_discount_start']) : null,
465
+				'expiration'     => isset($_POST['wpinv_discount_expiration']) ? wpinv_clean($_POST['wpinv_discount_expiration']) : null,
466
+				'is_single_use'  => !empty($_POST['wpinv_discount_single_use']),
467
+                'type'           => isset($_POST['wpinv_discount_type']) ? wpinv_clean($_POST['wpinv_discount_type']) : null,
468
+				'is_recurring'   => !empty($_POST['wpinv_discount_recurring']),
469
+				'items'          => isset($_POST['wpinv_discount_items']) ? wpinv_clean($_POST['wpinv_discount_items']) : array(),
470
+				'excluded_items' => isset($_POST['wpinv_discount_excluded_items']) ? wpinv_clean($_POST['wpinv_discount_excluded_items']) : array(),
471
+                'required_items' => isset($_POST['wpinv_discount_required_items']) ? wpinv_clean($_POST['wpinv_discount_required_items']) : array(),
472
+				'max_uses'       => isset($_POST['wpinv_discount_max_uses']) ? intval($_POST['wpinv_discount_max_uses']) : null,
473
+				'min_total'      => isset($_POST['wpinv_discount_min_total']) ? floatval($_POST['wpinv_discount_min_total']) : null,
474
+				'max_total'      => isset($_POST['wpinv_discount_max_total']) ? floatval($_POST['wpinv_discount_max_total']) : null,
475 475
 			)
476 476
         );
477 477
 
478 478
 		$discount->save();
479
-		do_action( 'getpaid_discount_metabox_save', $post_id, $discount );
479
+		do_action('getpaid_discount_metabox_save', $post_id, $discount);
480 480
 	}
481 481
 }
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-item-details.php 1 patch
Spacing   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  *
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) ) {
10
+if (!defined('ABSPATH')) {
11 11
 	exit; // Exit if accessed directly
12 12
 }
13 13
 
@@ -21,27 +21,27 @@  discard block
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WP_Post $post
23 23
 	 */
24
-    public static function output( $post ) {
24
+    public static function output($post) {
25 25
 
26 26
         // Prepare the item.
27
-        $item = new WPInv_Item( $post );
27
+        $item = new WPInv_Item($post);
28 28
 
29 29
         // Nonce field.
30
-        wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' );
30
+        wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce');
31 31
 
32 32
         // Set the currency position.
33 33
         $position = wpinv_currency_position();
34 34
 
35
-        if ( $position == 'left_space' ) {
35
+        if ($position == 'left_space') {
36 36
             $position = 'left';
37 37
         }
38 38
 
39
-        if ( $position == 'right_space' ) {
39
+        if ($position == 'right_space') {
40 40
             $position = 'right';
41 41
         }
42 42
 
43 43
         ?>
44
-        <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr( $item->get_type( 'edit' ) ); ?>" />
44
+        <input type="hidden" id="_wpi_current_type" value="<?php echo esc_attr($item->get_type('edit')); ?>" />
45 45
         <style>
46 46
             #poststuff .input-group-text,
47 47
             #poststuff .form-control {
@@ -55,36 +55,36 @@  discard block
 block discarded – undo
55 55
         </style>
56 56
         <div class='bsui' style='max-width: 600px;padding-top: 10px;'>
57 57
 
58
-            <?php do_action( 'wpinv_item_details_metabox_before_price', $item ); ?>
58
+            <?php do_action('wpinv_item_details_metabox_before_price', $item); ?>
59 59
             <div class="form-group mb-3 row">
60
-                <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php esc_html_e( 'Item Price', 'invoicing' ); ?></span></label>
60
+                <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php esc_html_e('Item Price', 'invoicing'); ?></span></label>
61 61
                 <div class="col-sm-8">
62 62
                     <div class="row">
63 63
                         <div class="col-sm-4 getpaid-price-input">
64 64
                             <div class="input-group input-group-sm">
65 65
 
66
-                                <?php if ( 'left' == $position ) : ?>
67
-                                    <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
66
+                                <?php if ('left' == $position) : ?>
67
+                                    <?php if (empty($GLOBALS['aui_bs5'])) : ?>
68 68
                                         <div class="input-group-prepend">
69
-                                            <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
69
+                                            <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
70 70
                                         </div>
71 71
                                     <?php else : ?>
72 72
                                         <span class="input-group-text">
73
-                                            <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
73
+                                            <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
74 74
                                         </span>
75 75
                                     <?php endif; ?>
76 76
                                 <?php endif; ?>
77 77
 
78
-                                <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr( getpaid_unstandardize_amount( $item->get_price( 'edit' ) ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control">
78
+                                <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr(getpaid_unstandardize_amount($item->get_price('edit'))); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control">
79 79
 
80
-                                <?php if ( 'left' != $position ) : ?>
81
-                                    <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
80
+                                <?php if ('left' != $position) : ?>
81
+                                    <?php if (empty($GLOBALS['aui_bs5'])) : ?>
82 82
                                         <div class="input-group-append">
83
-                                            <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
83
+                                            <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
84 84
                                         </div>
85 85
                                     <?php else : ?>
86 86
                                         <span class="input-group-text">
87
-                                            <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
87
+                                            <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
88 88
                                         </span>
89 89
                                     <?php endif; ?>
90 90
                                 <?php endif; ?>
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
                         </div>
94 94
                         <div class="col-sm-4 wpinv_show_if_recurring">
95 95
                             <?php
96
-                                esc_html_e( 'every' );
96
+                                esc_html_e('every');
97 97
                                 echo '&nbsp;';
98 98
                             ?>
99
-                            <input type="number" style="max-width: 60px;" value="<?php echo esc_attr( $item->get_recurring_interval( 'edit' ) ); ?>" placeholder="1" name="wpinv_recurring_interval" id="wpinv_recurring_interval" />
99
+                            <input type="number" style="max-width: 60px;" value="<?php echo esc_attr($item->get_recurring_interval('edit')); ?>" placeholder="1" name="wpinv_recurring_interval" id="wpinv_recurring_interval" />
100 100
                         </div>
101 101
                         <div class="col-sm-4 wpinv_show_if_recurring">
102 102
                             <?php
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
                                     array(
105 105
                                         'id'               => 'wpinv_recurring_period',
106 106
                                         'name'             => 'wpinv_recurring_period',
107
-                                        'label'            => __( 'Period', 'invoicing' ),
108
-                                        'placeholder'      => __( 'Select Period', 'invoicing' ),
109
-                                        'value'            => $item->get_recurring_period( 'edit' ),
107
+                                        'label'            => __('Period', 'invoicing'),
108
+                                        'placeholder'      => __('Select Period', 'invoicing'),
109
+                                        'value'            => $item->get_recurring_period('edit'),
110 110
                                         'select2'          => true,
111 111
                                         'data-allow-clear' => 'false',
112 112
                                         'options'          => array(
113
-                                            'D' => __( 'day(s)', 'invoicing' ),
114
-                                            'W' => __( 'week(s)', 'invoicing' ),
115
-                                            'M' => __( 'month(s)', 'invoicing' ),
116
-                                            'Y' => __( 'year(s)', 'invoicing' ),
113
+                                            'D' => __('day(s)', 'invoicing'),
114
+                                            'W' => __('week(s)', 'invoicing'),
115
+                                            'M' => __('month(s)', 'invoicing'),
116
+                                            'Y' => __('year(s)', 'invoicing'),
117 117
                                         ),
118 118
                                     ),
119 119
                                     true
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
                             <?php
127 127
 
128 128
                                 // Dynamic pricing.
129
-                                if ( $item->supports_dynamic_pricing() ) {
129
+                                if ($item->supports_dynamic_pricing()) {
130 130
 
131
-								do_action( 'wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item );
131
+								do_action('wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item);
132 132
 
133 133
 								// NYP toggle.
134 134
 								aui()->input(
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 								'id'      => 'wpinv_name_your_price',
137 137
 								'name'    => 'wpinv_name_your_price',
138 138
 								'type'    => 'checkbox',
139
-								'label'   => apply_filters( 'wpinv_name_your_price_toggle_text', __( 'Let customers name their price', 'invoicing' ) ),
139
+								'label'   => apply_filters('wpinv_name_your_price_toggle_text', __('Let customers name their price', 'invoicing')),
140 140
 								'value'   => '1',
141 141
 								'checked' => $item->user_can_set_their_price(),
142 142
 								'no_wrap' => true,
@@ -144,71 +144,71 @@  discard block
 block discarded – undo
144 144
                                     true
145 145
                                 );
146 146
 
147
-							do_action( 'wpinv_item_details_metabox_dynamic_pricing_checkbox', $item );
147
+							do_action('wpinv_item_details_metabox_dynamic_pricing_checkbox', $item);
148 148
 
149 149
                                 }
150 150
 
151 151
                                 // Subscriptions.
152
-                                do_action( 'wpinv_item_details_metabox_before_subscription_checkbox', $item );
152
+                                do_action('wpinv_item_details_metabox_before_subscription_checkbox', $item);
153 153
                                 aui()->input(
154 154
                                     array(
155 155
                                         'id'      => 'wpinv_is_recurring',
156 156
                                         'name'    => 'wpinv_is_recurring',
157 157
                                         'type'    => 'checkbox',
158
-                                        'label'   => apply_filters( 'wpinv_is_recurring_toggle_text', __( 'Charge customers a recurring amount for this item', 'invoicing' ) ),
158
+                                        'label'   => apply_filters('wpinv_is_recurring_toggle_text', __('Charge customers a recurring amount for this item', 'invoicing')),
159 159
                                         'value'   => '1',
160 160
                                         'checked' => $item->is_recurring(),
161 161
                                         'no_wrap' => true,
162 162
                                     ),
163 163
                                     true
164 164
                                 );
165
-                                do_action( 'wpinv_item_details_metabox_subscription_checkbox', $item );
165
+                                do_action('wpinv_item_details_metabox_subscription_checkbox', $item);
166 166
 
167 167
                             ?>
168 168
                             <div class="wpinv_show_if_recurring">
169
-                                <em><?php echo wp_kses_post( wpinv_get_recurring_gateways_text() ); ?></em>
169
+                                <em><?php echo wp_kses_post(wpinv_get_recurring_gateways_text()); ?></em>
170 170
                             </div>
171 171
                         </div>
172 172
                     </div>
173 173
                 </div>
174 174
                 <div class="col-sm-1 pt-2 pl-0">
175
-                    <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e( 'Set the subscription price, billing interval and period.', 'invoicing' ); ?>"></span>
175
+                    <span class="wpi-help-tip dashicons dashicons-editor-help wpinv_show_if_recurring" title="<?php esc_attr_e('Set the subscription price, billing interval and period.', 'invoicing'); ?>"></span>
176 176
                 </div>
177 177
             </div>
178
-            <?php do_action( 'wpinv_item_details_metabox_after_price', $item ); ?>
178
+            <?php do_action('wpinv_item_details_metabox_after_price', $item); ?>
179 179
 
180
-            <?php if ( $item->supports_dynamic_pricing() ) : ?>
181
-                <?php do_action( 'wpinv_item_details_metabox_before_minimum_price', $item ); ?>
180
+            <?php if ($item->supports_dynamic_pricing()) : ?>
181
+                <?php do_action('wpinv_item_details_metabox_before_minimum_price', $item); ?>
182 182
                 <div class="wpinv_show_if_dynamic wpinv_minimum_price">
183 183
 
184 184
                     <div class="form-group mb-3 row">
185 185
                         <label for="wpinv_minimum_price" class="col-sm-3 col-form-label">
186
-                            <?php esc_html_e( 'Minimum Price', 'invoicing' ); ?>
186
+                            <?php esc_html_e('Minimum Price', 'invoicing'); ?>
187 187
                         </label>
188 188
                         <div class="col-sm-8">
189 189
                             <div class="input-group input-group-sm">
190
-                                <?php if ( 'left' == $position ) : ?>
191
-                                    <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
190
+                                <?php if ('left' == $position) : ?>
191
+                                    <?php if (empty($GLOBALS['aui_bs5'])) : ?>
192 192
                                         <div class="input-group-prepend">
193
-                                            <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
193
+                                            <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
194 194
                                         </div>
195 195
                                     <?php else : ?>
196 196
                                         <span class="input-group-text">
197
-                                            <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
197
+                                            <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
198 198
                                         </span>
199 199
                                     <?php endif; ?>
200 200
                                 <?php endif; ?>
201 201
 
202
-                                <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr( getpaid_unstandardize_amount( $item->get_minimum_price( 'edit' ) ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control">
202
+                                <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr(getpaid_unstandardize_amount($item->get_minimum_price('edit'))); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control">
203 203
 
204
-                                <?php if ( 'left' != $position ) : ?>
205
-                                    <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
204
+                                <?php if ('left' != $position) : ?>
205
+                                    <?php if (empty($GLOBALS['aui_bs5'])) : ?>
206 206
                                         <div class="input-group-append">
207
-                                            <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
207
+                                            <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
208 208
                                         </div>
209 209
                                     <?php else : ?>
210 210
                                         <span class="input-group-text">
211
-                                            <?php echo wp_kses_post( wpinv_currency_symbol() ); ?>
211
+                                            <?php echo wp_kses_post(wpinv_currency_symbol()); ?>
212 212
                                         </span>
213 213
                                     <?php endif; ?>
214 214
                                 <?php endif; ?>
@@ -216,45 +216,45 @@  discard block
 block discarded – undo
216 216
                         </div>
217 217
 
218 218
                         <div class="col-sm-1 pt-2 pl-0">
219
-                            <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Enter the minimum amount that users are allowed to set', 'invoicing' ); ?>"></span>
219
+                            <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Enter the minimum amount that users are allowed to set', 'invoicing'); ?>"></span>
220 220
                         </div>
221 221
                     </div>
222 222
 
223 223
                 </div>
224
-                <?php do_action( 'wpinv_item_details_metabox_minimum_price', $item ); ?>
224
+                <?php do_action('wpinv_item_details_metabox_minimum_price', $item); ?>
225 225
             <?php endif; ?>
226 226
 
227
-            <?php do_action( 'wpinv_item_details_metabox_before_maximum_renewals', $item ); ?>
227
+            <?php do_action('wpinv_item_details_metabox_before_maximum_renewals', $item); ?>
228 228
             <div class="wpinv_show_if_recurring wpinv_maximum_renewals">
229 229
 
230 230
                 <div class="form-group mb-3 row">
231 231
                     <label for="wpinv_recurring_limit" class="col-sm-3 col-form-label">
232
-                        <?php esc_html_e( 'Maximum Renewals', 'invoicing' ); ?>
232
+                        <?php esc_html_e('Maximum Renewals', 'invoicing'); ?>
233 233
                     </label>
234 234
                     <div class="col-sm-8">
235
-                        <input type="number" value="<?php echo esc_attr( $item->get_recurring_limit( 'edit' ) ); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" />
235
+                        <input type="number" value="<?php echo esc_attr($item->get_recurring_limit('edit')); ?>" placeholder="0" name="wpinv_recurring_limit" id="wpinv_recurring_limit" style="width: 100%;" />
236 236
                     </div>
237 237
                     <div class="col-sm-1 pt-2 pl-0">
238
-                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing' ); ?>"></span>
238
+                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('Leave empty if you want the subscription to renew until it is cancelled.', 'invoicing'); ?>"></span>
239 239
                     </div>
240 240
                 </div>
241 241
 
242 242
             </div>
243
-            <?php do_action( 'wpinv_item_details_metabox_maximum_renewals', $item ); ?>
243
+            <?php do_action('wpinv_item_details_metabox_maximum_renewals', $item); ?>
244 244
 
245
-            <?php do_action( 'wpinv_item_details_metabox_before_free_trial', $item ); ?>
245
+            <?php do_action('wpinv_item_details_metabox_before_free_trial', $item); ?>
246 246
             <div class="wpinv_show_if_recurring wpinv_free_trial">
247 247
 
248 248
                 <div class="form-group mb-3 row">
249
-                    <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php defined( 'GETPAID_PAID_TRIALS_VERSION' ) ? esc_html_e( 'Free/Paid Trial', 'invoicing' ) : esc_html_e( 'Free Trial', 'invoicing' ); ?></label>
249
+                    <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php defined('GETPAID_PAID_TRIALS_VERSION') ? esc_html_e('Free/Paid Trial', 'invoicing') : esc_html_e('Free Trial', 'invoicing'); ?></label>
250 250
 
251 251
                     <div class="col-sm-8">
252 252
                         <div class="row">
253 253
                             <div class="col-sm-6">
254
-                                <?php $value = $item->has_free_trial() ? $item->get_trial_interval( 'edit' ) : 0; ?>
254
+                                <?php $value = $item->has_free_trial() ? $item->get_trial_interval('edit') : 0; ?>
255 255
 
256 256
                                 <div>
257
-                                    <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr( $value ); ?>" >
257
+                                    <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr($value); ?>" >
258 258
                                 </div>
259 259
                             </div>
260 260
                             <div class="col-sm-6">
@@ -263,17 +263,17 @@  discard block
 block discarded – undo
263 263
                                         array(
264 264
                                             'id'          => 'wpinv_trial_period',
265 265
                                             'name'        => 'wpinv_trial_period',
266
-                                            'label'       => __( 'Trial Period', 'invoicing' ),
267
-                                            'placeholder' => __( 'Trial Period', 'invoicing' ),
268
-                                            'value'       => $item->get_trial_period( 'edit' ),
266
+                                            'label'       => __('Trial Period', 'invoicing'),
267
+                                            'placeholder' => __('Trial Period', 'invoicing'),
268
+                                            'value'       => $item->get_trial_period('edit'),
269 269
                                             'select2'     => true,
270 270
                                             'data-allow-clear' => 'false',
271 271
                                             'no_wrap'     => true,
272 272
                                             'options'     => array(
273
-                                                'D' => __( 'day(s)', 'invoicing' ),
274
-                                                'W' => __( 'week(s)', 'invoicing' ),
275
-                                                'M' => __( 'month(s)', 'invoicing' ),
276
-                                                'Y' => __( 'year(s)', 'invoicing' ),
273
+                                                'D' => __('day(s)', 'invoicing'),
274
+                                                'W' => __('week(s)', 'invoicing'),
275
+                                                'M' => __('month(s)', 'invoicing'),
276
+                                                'Y' => __('year(s)', 'invoicing'),
277 277
                                             ),
278 278
                                         ),
279 279
                                         true
@@ -285,15 +285,15 @@  discard block
 block discarded – undo
285 285
                     </div>
286 286
 
287 287
                     <div class="col-sm-1 pt-2 pl-0">
288
-                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'An optional period of time to wait before charging the first recurring payment.', 'invoicing' ); ?>"></span>
288
+                        <span class="wpi-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e('An optional period of time to wait before charging the first recurring payment.', 'invoicing'); ?>"></span>
289 289
                     </div>
290 290
 
291 291
                 </div>
292 292
 
293 293
             </div>
294
-            <?php do_action( 'wpinv_item_details_metabox__free_trial', $item ); ?>
294
+            <?php do_action('wpinv_item_details_metabox__free_trial', $item); ?>
295 295
 
296
-            <?php do_action( 'wpinv_item_details_metabox_item_details', $item ); ?>
296
+            <?php do_action('wpinv_item_details_metabox_item_details', $item); ?>
297 297
         </div>
298 298
         <?php
299 299
 
@@ -304,31 +304,31 @@  discard block
 block discarded – undo
304 304
 	 *
305 305
 	 * @param int $post_id
306 306
 	 */
307
-	public static function save( $post_id ) {
307
+	public static function save($post_id) {
308 308
 
309 309
         // Prepare the item.
310
-        $item = new WPInv_Item( $post_id );
310
+        $item = new WPInv_Item($post_id);
311 311
 
312 312
         // Load new data.
313 313
         $item->set_props(
314 314
 			array(
315
-				'price'              => isset( $_POST['wpinv_item_price'] ) ? getpaid_standardize_amount( $_POST['wpinv_item_price'] ) : null,
316
-				'vat_rule'           => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null,
317
-				'vat_class'          => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null,
318
-				'type'               => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null,
319
-				'is_dynamic_pricing' => ! empty( $_POST['wpinv_name_your_price'] ),
320
-                'minimum_price'      => isset( $_POST['wpinv_minimum_price'] ) ? getpaid_standardize_amount( $_POST['wpinv_minimum_price'] ) : null,
321
-				'is_recurring'       => ! empty( $_POST['wpinv_is_recurring'] ),
322
-				'recurring_period'   => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null,
323
-				'recurring_interval' => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : 1,
324
-				'recurring_limit'    => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null,
325
-				'is_free_trial'      => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null,
326
-				'trial_period'       => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null,
327
-				'trial_interval'     => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null,
315
+				'price'              => isset($_POST['wpinv_item_price']) ? getpaid_standardize_amount($_POST['wpinv_item_price']) : null,
316
+				'vat_rule'           => isset($_POST['wpinv_vat_rules']) ? wpinv_clean($_POST['wpinv_vat_rules']) : null,
317
+				'vat_class'          => isset($_POST['wpinv_vat_class']) ? wpinv_clean($_POST['wpinv_vat_class']) : null,
318
+				'type'               => isset($_POST['wpinv_item_type']) ? wpinv_clean($_POST['wpinv_item_type']) : null,
319
+				'is_dynamic_pricing' => !empty($_POST['wpinv_name_your_price']),
320
+                'minimum_price'      => isset($_POST['wpinv_minimum_price']) ? getpaid_standardize_amount($_POST['wpinv_minimum_price']) : null,
321
+				'is_recurring'       => !empty($_POST['wpinv_is_recurring']),
322
+				'recurring_period'   => isset($_POST['wpinv_recurring_period']) ? wpinv_clean($_POST['wpinv_recurring_period']) : null,
323
+				'recurring_interval' => isset($_POST['wpinv_recurring_interval']) ? (int) $_POST['wpinv_recurring_interval'] : 1,
324
+				'recurring_limit'    => isset($_POST['wpinv_recurring_limit']) ? (int) $_POST['wpinv_recurring_limit'] : null,
325
+				'is_free_trial'      => isset($_POST['wpinv_trial_interval']) ? (0 != (int) $_POST['wpinv_trial_interval']) : null,
326
+				'trial_period'       => isset($_POST['wpinv_trial_period']) ? wpinv_clean($_POST['wpinv_trial_period']) : null,
327
+				'trial_interval'     => isset($_POST['wpinv_trial_interval']) ? (int) $_POST['wpinv_trial_interval'] : null,
328 328
 			)
329 329
         );
330 330
 
331 331
 		$item->save();
332
-		do_action( 'getpaid_item_metabox_save', $post_id, $item );
332
+		do_action('getpaid_item_metabox_save', $post_id, $item);
333 333
 	}
334 334
 }
Please login to merge, or discard this patch.
templates/payment-forms-admin/previews/price_input.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,16 +7,16 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Set the currency position.
13 13
 $position = wpinv_currency_position();
14 14
 
15
-if ( $position == 'left_space' ) {
15
+if ($position == 'left_space') {
16 16
     $position = 'left';
17 17
 }
18 18
 
19
-if ( $position == 'right_space' ) {
19
+if ($position == 'right_space') {
20 20
     $position = 'right';
21 21
 }
22 22
 
@@ -26,25 +26,25 @@  discard block
 block discarded – undo
26 26
 
27 27
 <div class="input-group">
28 28
 
29
-    <?php if ( $position == 'left' ) : ?>
30
-        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
29
+    <?php if ($position == 'left') : ?>
30
+        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
31 31
             <div class="input-group-prepend ">
32
-                <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
32
+                <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
33 33
             </div>
34 34
         <?php else : ?>
35
-            <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
35
+            <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
36 36
         <?php endif; ?>
37 37
     <?php endif; ?>
38 38
 
39 39
     <input :placeholder='form_element.placeholder' class='form-control' type='text'>
40 40
 
41
-    <?php if ( $position == 'right' ) : ?>
42
-        <?php if ( empty( $GLOBALS['aui_bs5'] ) ) : ?>
41
+    <?php if ($position == 'right') : ?>
42
+        <?php if (empty($GLOBALS['aui_bs5'])) : ?>
43 43
             <div class="input-group-append ">
44
-                <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
44
+                <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
45 45
             </div>
46 46
         <?php else : ?>
47
-            <span class="input-group-text"><?php echo wp_kses_post( wpinv_currency_symbol() ); ?></span>
47
+            <span class="input-group-text"><?php echo wp_kses_post(wpinv_currency_symbol()); ?></span>
48 48
         <?php endif; ?>
49 49
     <?php endif; ?>
50 50
 </div>
Please login to merge, or discard this patch.