Passed
Push — master ( a8c7c0...17a5f2 )
by Brian
15:49 queued 10s
created
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-payment-meta.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Payment_Meta {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 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,10 +21,10 @@  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 invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         ?>
30 30
 
@@ -47,12 +47,12 @@  discard block
 block discarded – undo
47 47
                                 'id'          => 'wpinv_key',
48 48
                                 'name'        => 'wpinv_key',
49 49
                                 'label'       => sprintf(
50
-                                    __( '%s Key:', 'invoicing' ),
51
-                                    ucfirst( $invoice->get_type() )
50
+                                    __('%s Key:', 'invoicing'),
51
+                                    ucfirst($invoice->get_type())
52 52
                                 ),
53 53
                                 'label_type'  => 'vertical',
54 54
                                 'class'       => 'form-control-sm',
55
-                                'value'       => $invoice->get_key( 'edit' ),
55
+                                'value'       => $invoice->get_key('edit'),
56 56
                                 'extra_attributes' => array(
57 57
                                     'onclick'  => 'this.select();',
58 58
                                     'readonly' => 'true',
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
                                 'id'          => 'wpinv_view_url',
68 68
                                 'name'        => 'wpinv_view_url',
69 69
                                 'label'       => sprintf(
70
-                                    __( '%s URL:', 'invoicing' ),
71
-                                    ucfirst( $invoice->get_type() )
70
+                                    __('%s URL:', 'invoicing'),
71
+                                    ucfirst($invoice->get_type())
72 72
                                 ),
73 73
                                 'label_type'  => 'vertical',
74 74
                                 'class'       => 'form-control-sm',
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                         );
82 82
 
83 83
                         // If the invoice is paid...
84
-                        if ( $invoice->is_paid() || $invoice->is_refunded() ) {
84
+                        if ($invoice->is_paid() || $invoice->is_refunded()) {
85 85
 
86 86
                             // Payment date.
87 87
                             echo aui()->input(
@@ -89,11 +89,11 @@  discard block
 block discarded – undo
89 89
                                     'type'        => 'datepicker',
90 90
                                     'id'          => 'wpinv_date_completed',
91 91
                                     'name'        => 'date_completed',
92
-                                    'label'       => __( 'Payment Date:', 'invoicing' ),
92
+                                    'label'       => __('Payment Date:', 'invoicing'),
93 93
                                     'label_type'  => 'vertical',
94 94
                                     'placeholder' => 'YYYY-MM-DD 00:00',
95 95
                                     'class'       => 'form-control-sm',
96
-                                    'value'       => $invoice->get_date_completed( 'edit' ),
96
+                                    'value'       => $invoice->get_date_completed('edit'),
97 97
                                     'extra_attributes' => array(
98 98
                                         'data-enable-time' => 'true',
99 99
                                         'data-time_24hr'   => 'true',
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
                                     'type'        => 'text',
109 109
                                     'id'          => 'wpinv_gateway',
110 110
                                     'name'        => 'wpinv_gateway',
111
-                                    'label'       => __( 'Gateway:', 'invoicing' ),
111
+                                    'label'       => __('Gateway:', 'invoicing'),
112 112
                                     'label_type'  => 'vertical',
113 113
                                     'class'       => 'form-control-sm',
114
-                                    'value'       => wpinv_get_gateway_admin_label( $invoice->get_gateway( 'edit' ) ),
114
+                                    'value'       => wpinv_get_gateway_admin_label($invoice->get_gateway('edit')),
115 115
                                     'extra_attributes' => array(
116 116
                                         'onclick'  => 'this.select();',
117 117
                                         'readonly' => 'true',
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
                                     'type'        => 'text',
126 126
                                     'id'          => 'wpinv_transaction_id',
127 127
                                     'name'        => 'wpinv_transaction_id',
128
-                                    'label'       => __( 'Transaction ID:', 'invoicing' ),
128
+                                    'label'       => __('Transaction ID:', 'invoicing'),
129 129
                                     'label_type'  => 'vertical',
130 130
                                     'class'       => 'form-control-sm',
131
-                                    'value'       => $invoice->get_transaction_id( 'edit' ),
132
-                                    'help_text'   => apply_filters( 'wpinv_invoice_transaction_link_' . $invoice->get_gateway( 'edit' ), '', $invoice->get_transaction_id(), $invoice ),
131
+                                    'value'       => $invoice->get_transaction_id('edit'),
132
+                                    'help_text'   => apply_filters('wpinv_invoice_transaction_link_' . $invoice->get_gateway('edit'), '', $invoice->get_transaction_id(), $invoice),
133 133
                                     'extra_attributes' => array(
134 134
                                         'onclick'  => 'this.select();',
135 135
                                         'readonly' => 'true',
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
                                     'type'        => 'text',
144 144
                                     'id'          => 'wpinv_currency',
145 145
                                     'name'        => 'wpinv_currency',
146
-                                    'label'       => __( 'Currency:', 'invoicing' ),
146
+                                    'label'       => __('Currency:', 'invoicing'),
147 147
                                     'label_type'  => 'vertical',
148 148
                                     'class'       => 'form-control-sm',
149
-                                    'value'       => $invoice->get_currency( 'edit' ),
149
+                                    'value'       => $invoice->get_currency('edit'),
150 150
                                     'extra_attributes' => array(
151 151
                                         'onclick'  => 'this.select();',
152 152
                                         'readonly' => 'true',
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
                         } else {
158 158
 
159
-                            if ( 'wpi_invoice' == $invoice->get_post_type() ) {
159
+                            if ('wpi_invoice' == $invoice->get_post_type()) {
160 160
 
161 161
                                 // Payment URL.
162 162
                                 echo aui()->input(
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                                         'type'        => 'text',
165 165
                                         'id'          => 'wpinv_payment_url',
166 166
                                         'name'        => 'wpinv_payment_url',
167
-                                        'label'       => __( 'Payment URL:', 'invoicing' ),
167
+                                        'label'       => __('Payment URL:', 'invoicing'),
168 168
                                         'label_type'  => 'vertical',
169 169
                                         'class'       => 'form-control-sm',
170 170
                                         'value'       => $invoice->get_checkout_payment_url(),
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
                                     array(
181 181
                                         'id'               => 'wpinv_gateway',
182 182
                                         'name'             => 'wpinv_gateway',
183
-                                        'label'            => __( 'Gateway:', 'invoicing' ),
183
+                                        'label'            => __('Gateway:', 'invoicing'),
184 184
                                         'label_type'       => 'vertical',
185
-                                        'placeholder'      => __( 'Select Gateway', 'invoicing' ),
186
-                                        'value'            => $invoice->get_gateway( 'edit' ),
185
+                                        'placeholder'      => __('Select Gateway', 'invoicing'),
186
+                                        'value'            => $invoice->get_gateway('edit'),
187 187
                                         'select2'          => true,
188 188
                                         'data-allow-clear' => 'false',
189
-                                        'options'          => wp_list_pluck( wpinv_get_enabled_payment_gateways( true ), 'admin_label' ),
189
+                                        'options'          => wp_list_pluck(wpinv_get_enabled_payment_gateways(true), 'admin_label'),
190 190
                                     )
191 191
                                 );
192 192
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-details.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Details {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 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,13 +21,13 @@  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 invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29 29
         // Nonce field.
30
-        wp_nonce_field( 'wpinv_details', 'wpinv_details_nonce' ) ;
30
+        wp_nonce_field('wpinv_details', 'wpinv_details_nonce');
31 31
 
32 32
 
33 33
         ?>
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
                 <div class="bsui" style="margin-top: 1.5rem">
48 48
 
49
-                    <?php if ( ! $invoice->is_draft() ) : ?>
49
+                    <?php if (!$invoice->is_draft()) : ?>
50 50
                         <div class="form-group">
51
-                            <strong><?php _e( 'Viewed by Customer:', 'invoicing' );?></strong>
52
-                            <?php ( $invoice->get_is_viewed() ) ? _e( 'Yes', 'invoicing' ) : _e( 'No', 'invoicing' ); ?>
51
+                            <strong><?php _e('Viewed by Customer:', 'invoicing'); ?></strong>
52
+                            <?php ($invoice->get_is_viewed()) ? _e('Yes', 'invoicing') : _e('No', 'invoicing'); ?>
53 53
                         </div>
54 54
                     <?php endif; ?>
55 55
 
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
 
58 58
                         // Date created.
59 59
                         $label = sprintf(
60
-                            __( '%s Date:', 'invoicing' ),
61
-                            ucfirst( $invoice->get_type() )
60
+                            __('%s Date:', 'invoicing'),
61
+                            ucfirst($invoice->get_type())
62 62
                         );
63 63
 
64
-                        $info  = sprintf(
65
-                            __( 'The date this %s was created.', 'invoicing' ),
66
-                            strtolower( $invoice->get_type() )
64
+                        $info = sprintf(
65
+                            __('The date this %s was created.', 'invoicing'),
66
+                            strtolower($invoice->get_type())
67 67
                         );
68 68
 
69 69
                         echo aui()->input(
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
                                 'type'        => 'datepicker',
72 72
                                 'id'          => 'wpinv_date_created',
73 73
                                 'name'        => 'date_created',
74
-                                'label'       => $label . getpaid_get_help_tip( $info ),
74
+                                'label'       => $label . getpaid_get_help_tip($info),
75 75
                                 'label_type'  => 'vertical',
76 76
                                 'placeholder' => 'YYYY-MM-DD 00:00',
77 77
                                 'class'       => 'form-control-sm',
78
-                                'value'       => $invoice->get_date_created( 'edit' ),
78
+                                'value'       => $invoice->get_date_created('edit'),
79 79
                                 'extra_attributes' => array(
80 80
                                     'data-enable-time' => 'true',
81 81
                                     'data-time_24hr'   => 'true',
@@ -86,30 +86,30 @@  discard block
 block discarded – undo
86 86
                         );
87 87
 
88 88
                         // Due date.
89
-                        if ( $invoice->is_type( 'invoice' ) && wpinv_get_option( 'overdue_active' ) && ( $invoice->needs_payment() || $invoice->is_draft() ) ) {
89
+                        if ($invoice->is_type('invoice') && wpinv_get_option('overdue_active') && ($invoice->needs_payment() || $invoice->is_draft())) {
90 90
 
91 91
                             echo aui()->input(
92 92
                                 array(
93 93
                                     'type'        => 'text',
94 94
                                     'id'          => 'wpinv_due_date',
95 95
                                     'name'        => 'wpinv_due_date',
96
-                                    'label'       => __( 'Due Date:', 'invoicing' ) . getpaid_get_help_tip( __( 'Leave blank to disable automated reminder emails for this invoice.', 'invoicing' ) ),
96
+                                    'label'       => __('Due Date:', 'invoicing') . getpaid_get_help_tip(__('Leave blank to disable automated reminder emails for this invoice.', 'invoicing')),
97 97
                                     'label_type'  => 'vertical',
98
-                                    'placeholder' => __( 'No due date', 'invoicing' ),
98
+                                    'placeholder' => __('No due date', 'invoicing'),
99 99
                                     'class'       => 'form-control-sm',
100
-                                    'value'       => $invoice->get_due_date( 'edit' ),
100
+                                    'value'       => $invoice->get_due_date('edit'),
101 101
                                 )
102 102
                             );
103 103
 
104 104
                         }
105 105
 
106
-                        do_action( 'wpinv_meta_box_details_after_due_date', $invoice->get_id() );
107
-                        do_action( 'getpaid_metabox_after_due_date', $invoice );
106
+                        do_action('wpinv_meta_box_details_after_due_date', $invoice->get_id());
107
+                        do_action('getpaid_metabox_after_due_date', $invoice);
108 108
 
109 109
                         // Status.
110 110
                         $label = sprintf(
111
-                            __( '%s Status:', 'invoicing' ),
112
-                            ucfirst( $invoice->get_type() )
111
+                            __('%s Status:', 'invoicing'),
112
+                            ucfirst($invoice->get_type())
113 113
                         );
114 114
 
115 115
                         echo aui()->select(
@@ -118,23 +118,23 @@  discard block
 block discarded – undo
118 118
                                 'name'             => 'wpinv_status',
119 119
                                 'label'            => $label,
120 120
                                 'label_type'       => 'vertical',
121
-                                'placeholder'      => __( 'Select Status', 'invoicing' ),
122
-                                'value'            => $invoice->get_status( 'edit' ),
121
+                                'placeholder'      => __('Select Status', 'invoicing'),
122
+                                'value'            => $invoice->get_status('edit'),
123 123
                                 'select2'          => true,
124 124
                                 'data-allow-clear' => 'false',
125
-                                'options'          => wpinv_get_invoice_statuses( true, false, $invoice )
125
+                                'options'          => wpinv_get_invoice_statuses(true, false, $invoice)
126 126
                             )
127 127
                         );
128 128
 
129 129
                         // Invoice number.
130 130
                         $label = sprintf(
131
-                            __( '%s Number:', 'invoicing' ),
132
-                            ucfirst( $invoice->get_type() )
131
+                            __('%s Number:', 'invoicing'),
132
+                            ucfirst($invoice->get_type())
133 133
                         );
134 134
 
135
-                        $info  = sprintf(
136
-                            __( 'Each %s number must be unique.', 'invoicing' ),
137
-                            strtolower( $invoice->get_type() )
135
+                        $info = sprintf(
136
+                            __('Each %s number must be unique.', 'invoicing'),
137
+                            strtolower($invoice->get_type())
138 138
                         );
139 139
 
140 140
                         echo aui()->input(
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
                                 'type'        => 'text',
143 143
                                 'id'          => 'wpinv_number',
144 144
                                 'name'        => 'wpinv_number',
145
-                                'label'       => $label . getpaid_get_help_tip( $info ),
145
+                                'label'       => $label . getpaid_get_help_tip($info),
146 146
                                 'label_type'  => 'vertical',
147
-                                'placeholder' => __( 'Autogenerate', 'invoicing' ),
147
+                                'placeholder' => __('Autogenerate', 'invoicing'),
148 148
                                 'class'       => 'form-control-sm',
149
-                                'value'       => $invoice->get_number( 'edit' ),
149
+                                'value'       => $invoice->get_number('edit'),
150 150
                             )
151 151
                         );
152 152
 
@@ -156,25 +156,25 @@  discard block
 block discarded – undo
156 156
                                 'type'        => 'text',
157 157
                                 'id'          => 'wpinv_cc',
158 158
                                 'name'        => 'wpinv_cc',
159
-                                'label'       => __( 'Email CC:', 'invoicing' ) . getpaid_get_help_tip( __( 'Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing' ) ),
159
+                                'label'       => __('Email CC:', 'invoicing') . getpaid_get_help_tip(__('Enter a comma separated list of other emails that should be notified about the invoice.', 'invoicing')),
160 160
                                 'label_type'  => 'vertical',
161
-                                'placeholder' => __( '[email protected], [email protected]', 'invoicing' ),
161
+                                'placeholder' => __('[email protected], [email protected]', 'invoicing'),
162 162
                                 'class'       => 'form-control-sm',
163
-                                'value'       => $invoice->get_email_cc( 'edit' ),
163
+                                'value'       => $invoice->get_email_cc('edit'),
164 164
                             )
165 165
                         );
166 166
 
167
-                        do_action( 'wpinv_meta_box_details_inner', $invoice->get_id() );
167
+                        do_action('wpinv_meta_box_details_inner', $invoice->get_id());
168 168
 
169 169
                         // Disable taxes.
170
-                        if ( wpinv_use_taxes() && ! ( $invoice->is_paid() || $invoice->is_refunded() ) ) {
170
+                        if (wpinv_use_taxes() && !($invoice->is_paid() || $invoice->is_refunded())) {
171 171
 
172 172
                             echo aui()->input(
173 173
                                 array(
174 174
                                     'id'          => 'wpinv_taxable',
175 175
                                     'name'        => 'disable_taxes',
176 176
                                     'type'        => 'checkbox',
177
-                                    'label'       => __( 'Disable taxes', 'invoicing' ),
177
+                                    'label'       => __('Disable taxes', 'invoicing'),
178 178
                                     'value'       => '1',
179 179
                                     'checked'     => (bool) $invoice->get_disable_taxes(),
180 180
                                 )
@@ -183,17 +183,17 @@  discard block
 block discarded – undo
183 183
                         }
184 184
 
185 185
                         // Apply a discount.
186
-                        if ( $invoice->get_discount_code( 'edit' ) ) {
186
+                        if ($invoice->get_discount_code('edit')) {
187 187
 
188 188
                             echo aui()->input(
189 189
                                 array(
190 190
                                     'type'        => 'text',
191 191
                                     'id'          => 'wpinv_discount_code',
192 192
                                     'name'        => 'wpinv_discount_code',
193
-                                    'label'       => __( 'Discount Code:', 'invoicing' ),
193
+                                    'label'       => __('Discount Code:', 'invoicing'),
194 194
                                     'label_type'  => 'vertical',
195 195
                                     'class'       => 'form-control-sm',
196
-                                    'value'       => $invoice->get_discount_code( 'edit' ),
196
+                                    'value'       => $invoice->get_discount_code('edit'),
197 197
                                     'extra_attributes' => array(
198 198
                                         'onclick'  => 'this.select();',
199 199
                                         'readonly' => 'true',
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-resend-invoice.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  */
7 7
 
8 8
 if ( ! defined( 'ABSPATH' ) ) {
9
-	exit; // Exit if accessed directly
9
+    exit; // Exit if accessed directly
10 10
 }
11 11
 
12 12
 /**
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 class GetPaid_Meta_Box_Resend_Invoice {
16 16
 
17 17
     /**
18
-	 * Output the metabox.
19
-	 *
20
-	 * @param WP_Post $post
21
-	 */
18
+     * Output the metabox.
19
+     *
20
+     * @param WP_Post $post
21
+     */
22 22
     public static function output( $post ) {
23 23
 
24 24
         // Fetch the invoice.
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  *
6 6
  */
7 7
 
8
-if ( ! defined( 'ABSPATH' ) ) {
8
+if (!defined('ABSPATH')) {
9 9
 	exit; // Exit if accessed directly
10 10
 }
11 11
 
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 	 *
20 20
 	 * @param WP_Post $post
21 21
 	 */
22
-    public static function output( $post ) {
22
+    public static function output($post) {
23 23
 
24 24
         // Fetch the invoice.
25
-        $invoice = new WPInv_Invoice( $post );
25
+        $invoice = new WPInv_Invoice($post);
26 26
 
27
-        do_action( 'wpinv_metabox_resend_invoice_before', $invoice );
27
+        do_action('wpinv_metabox_resend_invoice_before', $invoice);
28 28
 
29 29
         $email_url = esc_url(
30 30
             add_query_arg(
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
         );
51 51
 
52 52
         ?>
53
-            <p class="wpi-meta-row wpi-resend-info"><?php _e( "This will send a copy of the invoice to the customer's email address.", 'invoicing' ); ?></p>
54
-            <p class="wpi-meta-row wpi-resend-email"><a href="<?php echo $email_url; ?>" class="button button-secondary"><?php _e( 'Resend Invoice', 'invoicing' ); ?></a></p>
55
-            <p class="wpi-meta-row wpi-send-reminder"><a title="<?php esc_attr_e( 'Send overdue reminder notification to customer', 'invoicing' ); ?>" href="<?php echo $reminder_url; ?>" class="button button-secondary"><?php esc_attr_e( 'Send Reminder', 'invoicing' ); ?></a></p>
53
+            <p class="wpi-meta-row wpi-resend-info"><?php _e("This will send a copy of the invoice to the customer's email address.", 'invoicing'); ?></p>
54
+            <p class="wpi-meta-row wpi-resend-email"><a href="<?php echo $email_url; ?>" class="button button-secondary"><?php _e('Resend Invoice', 'invoicing'); ?></a></p>
55
+            <p class="wpi-meta-row wpi-send-reminder"><a title="<?php esc_attr_e('Send overdue reminder notification to customer', 'invoicing'); ?>" href="<?php echo $reminder_url; ?>" class="button button-secondary"><?php esc_attr_e('Send Reminder', 'invoicing'); ?></a></p>
56 56
         <?php
57 57
 
58
-        do_action( 'wpinv_metabox_resend_invoice_after', $invoice );
58
+        do_action('wpinv_metabox_resend_invoice_after', $invoice);
59 59
 
60 60
     }
61 61
 
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-mb-invoice-notes.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,39 +1,39 @@
 block discarded – undo
1 1
 <?php
2 2
 // MUST have WordPress.
3
-if ( !defined( 'WPINC' ) ) {
4
-    exit( 'Do NOT access this file directly: ' . basename( __FILE__ ) );
3
+if (!defined('WPINC')) {
4
+    exit('Do NOT access this file directly: ' . basename(__FILE__));
5 5
 }
6 6
 
7 7
 class WPInv_Meta_Box_Notes {
8
-    public static function output( $post ) {
8
+    public static function output($post) {
9 9
         global $post;
10 10
 
11
-        $notes = wpinv_get_invoice_notes( $post->ID );
11
+        $notes = wpinv_get_invoice_notes($post->ID);
12 12
 
13 13
         echo '<ul class="invoice_notes">';
14 14
 
15
-        if ( $notes ) {
16
-            foreach( $notes as $note ) {
17
-                wpinv_get_invoice_note_line_item( $note );
15
+        if ($notes) {
16
+            foreach ($notes as $note) {
17
+                wpinv_get_invoice_note_line_item($note);
18 18
             }
19 19
 
20 20
         } else {
21
-            echo '<li>' . __( 'There are no notes yet.', 'invoicing' ) . '</li>';
21
+            echo '<li>' . __('There are no notes yet.', 'invoicing') . '</li>';
22 22
         }
23 23
 
24 24
         echo '</ul>';
25 25
         ?>
26 26
         <div class="add_note">
27
-            <h4><?php _e( 'Add note', 'invoicing' ); ?></h4>
27
+            <h4><?php _e('Add note', 'invoicing'); ?></h4>
28 28
             <p>
29 29
                 <textarea type="text" name="invoice_note" id="add_invoice_note" class="input-text" cols="20" rows="5"></textarea>
30 30
             </p>
31 31
             <p>
32 32
                 <select name="invoice_note_type" id="invoice_note_type" class="regular-text">
33
-                    <option value=""><?php _e( 'Private note', 'invoicing' ); ?></option>
34
-                    <option value="customer"><?php _e( 'Note to customer', 'invoicing' ); ?></option>
33
+                    <option value=""><?php _e('Private note', 'invoicing'); ?></option>
34
+                    <option value="customer"><?php _e('Note to customer', 'invoicing'); ?></option>
35 35
                 </select>
36
-                <a href="#" class="add_note button"><?php _e( 'Add', 'invoicing' ); ?></a> <span class="description"><?php _e( 'Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing' ); ?></span>
36
+                <a href="#" class="add_note button"><?php _e('Add', 'invoicing'); ?></a> <span class="description"><?php _e('Add a note for your reference, or add a customer note (the user will be notified).', 'invoicing'); ?></span>
37 37
             </p>
38 38
         </div>
39 39
         <?php
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-item-details.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Item_Details {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the item.
@@ -289,35 +289,35 @@  discard block
 block discarded – undo
289 289
     }
290 290
 
291 291
     /**
292
-	 * Save meta box data.
293
-	 *
294
-	 * @param int $post_id
295
-	 */
296
-	public static function save( $post_id ) {
292
+     * Save meta box data.
293
+     *
294
+     * @param int $post_id
295
+     */
296
+    public static function save( $post_id ) {
297 297
 
298 298
         // Prepare the item.
299 299
         $item = new WPInv_Item( $post_id );
300 300
 
301 301
         // Load new data.
302 302
         $item->set_props(
303
-			array(
304
-				'price'                => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null,
305
-				'vat_rule'             => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null,
306
-				'vat_class'            => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null,
307
-				'type'                 => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null,
308
-				'is_dynamic_pricing'   => isset( $_POST['wpinv_name_your_price'] ),
303
+            array(
304
+                'price'                => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null,
305
+                'vat_rule'             => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null,
306
+                'vat_class'            => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null,
307
+                'type'                 => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null,
308
+                'is_dynamic_pricing'   => isset( $_POST['wpinv_name_your_price'] ),
309 309
                 'minimum_price'        => isset( $_POST['wpinv_minimum_price'] ) ? (float) $_POST['wpinv_minimum_price'] : null,
310
-				'is_recurring'         => isset( $_POST['wpinv_is_recurring'] ),
311
-				'recurring_period'     => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null,
312
-				'recurring_interval'   => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null,
313
-				'recurring_limit'      => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null,
314
-				'is_free_trial'        => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null,
315
-				'trial_period'         => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null,
316
-				'trial_interval'       => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null,
317
-			)
310
+                'is_recurring'         => isset( $_POST['wpinv_is_recurring'] ),
311
+                'recurring_period'     => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null,
312
+                'recurring_interval'   => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null,
313
+                'recurring_limit'      => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null,
314
+                'is_free_trial'        => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null,
315
+                'trial_period'         => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null,
316
+                'trial_interval'       => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null,
317
+            )
318 318
         );
319 319
 
320
-		$item->save();
321
-		do_action( 'getpaid_item_metabox_save', $post_id, $item );
322
-	}
320
+        $item->save();
321
+        do_action( 'getpaid_item_metabox_save', $post_id, $item );
322
+    }
323 323
 }
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 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,21 +55,21 @@  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 row">
60
-                <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php _e( 'Item Price', 'invoicing' )?></span></label>
60
+                <label class="col-sm-3 col-form-label" for="wpinv_item_price"><span><?php _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
-                                <?php if( 'left' == $position ) : ?>
65
+                                <?php if ('left' == $position) : ?>
66 66
                                 <div class="input-group-prepend">
67 67
                                     <span class="input-group-text" id="wpinv_item_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
68 68
                                 </div>
69 69
                                 <?php endif; ?>
70
-                                <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr( $item->get_price( 'edit' ) ); ?>" placeholder="<?php echo esc_attr( wpinv_sanitize_amount( 0 ) ); ?>" class="form-control">
70
+                                <input type="text" name="wpinv_item_price" id="wpinv_item_price" value="<?php echo esc_attr($item->get_price('edit')); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control">
71 71
 
72
-                                <?php if( 'left' != $position ) : ?>
72
+                                <?php if ('left' != $position) : ?>
73 73
                                 <div class="input-group-append">
74 74
                                     <span class="input-group-text" id="wpinv_item_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
75 75
                                 </div>
@@ -83,25 +83,25 @@  discard block
 block discarded – undo
83 83
                                     array(
84 84
                                         'id'               => 'wpinv_recurring_interval',
85 85
                                         'name'             => 'wpinv_recurring_interval',
86
-                                        'label'            => __( 'Interval', 'invoicing' ),
87
-                                        'placeholder'      => __( 'Select Interval', 'invoicing' ),
88
-                                        'value'            => $item->get_recurring_interval( 'edit' ),
86
+                                        'label'            => __('Interval', 'invoicing'),
87
+                                        'placeholder'      => __('Select Interval', 'invoicing'),
88
+                                        'value'            => $item->get_recurring_interval('edit'),
89 89
                                         'select2'          => true,
90 90
                                         'data-allow-clear' => 'false',
91 91
                                         'options'          => array(
92
-                                            '1'  => __( 'every', 'invoicing' ),
93
-                                            '2'  => __( 'every 2nd', 'invoicing' ),
94
-                                            '3'  => __( 'every 3rd', 'invoicing' ),
95
-                                            '4'  => __( 'every 4th', 'invoicing' ),
96
-                                            '5'  => __( 'every 5th', 'invoicing' ),
97
-                                            '6'  => __( 'every 6th', 'invoicing' ),
98
-                                            '8'  => __( 'every 8th', 'invoicing' ),
99
-                                            '9'  => __( 'every 9th', 'invoicing' ),
100
-                                            '10' => __( 'every 10th', 'invoicing' ),
101
-                                            '11' => __( 'every 11th', 'invoicing' ),
102
-                                            '12' => __( 'every 12th', 'invoicing' ),
103
-                                            '13' => __( 'every 13th', 'invoicing' ),
104
-                                            '14' => __( 'every 14th', 'invoicing' ),
92
+                                            '1'  => __('every', 'invoicing'),
93
+                                            '2'  => __('every 2nd', 'invoicing'),
94
+                                            '3'  => __('every 3rd', 'invoicing'),
95
+                                            '4'  => __('every 4th', 'invoicing'),
96
+                                            '5'  => __('every 5th', 'invoicing'),
97
+                                            '6'  => __('every 6th', 'invoicing'),
98
+                                            '8'  => __('every 8th', 'invoicing'),
99
+                                            '9'  => __('every 9th', 'invoicing'),
100
+                                            '10' => __('every 10th', 'invoicing'),
101
+                                            '11' => __('every 11th', 'invoicing'),
102
+                                            '12' => __('every 12th', 'invoicing'),
103
+                                            '13' => __('every 13th', 'invoicing'),
104
+                                            '14' => __('every 14th', 'invoicing'),
105 105
                                         )
106 106
                                     )
107 107
                                 );
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
                                     array(
114 114
                                         'id'               => 'wpinv_recurring_period',
115 115
                                         'name'             => 'wpinv_recurring_period',
116
-                                        'label'            => __( 'Period', 'invoicing' ),
117
-                                        'placeholder'      => __( 'Select Period', 'invoicing' ),
118
-                                        'value'            => $item->get_recurring_period( 'edit' ),
116
+                                        'label'            => __('Period', 'invoicing'),
117
+                                        'placeholder'      => __('Select Period', 'invoicing'),
118
+                                        'value'            => $item->get_recurring_period('edit'),
119 119
                                         'select2'          => true,
120 120
                                         'data-allow-clear' => 'false',
121 121
                                         'options'     => array(
122
-                                            'D'  => __( 'day', 'invoicing' ),
123
-                                            'W'  => __( 'week', 'invoicing' ),
124
-                                            'M'  => __( 'month', 'invoicing' ),
125
-                                            'Y'  => __( 'year', 'invoicing' ),
122
+                                            'D'  => __('day', 'invoicing'),
123
+                                            'W'  => __('week', 'invoicing'),
124
+                                            'M'  => __('month', 'invoicing'),
125
+                                            'Y'  => __('year', 'invoicing'),
126 126
                                         )
127 127
                                     )
128 128
                                 );
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
                             <?php
135 135
 
136 136
                                 // Dynamic pricing.
137
-                                if( $item->supports_dynamic_pricing() ) {
137
+                                if ($item->supports_dynamic_pricing()) {
138 138
 
139
-                                    do_action( 'wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item );
139
+                                    do_action('wpinv_item_details_metabox_before_dynamic_pricing_checkbox', $item);
140 140
 
141 141
                                     // NYP toggle.
142 142
                                     echo aui()->input(
@@ -144,31 +144,31 @@  discard block
 block discarded – undo
144 144
                                             'id'          => 'wpinv_name_your_price',
145 145
                                             'name'        => 'wpinv_name_your_price',
146 146
                                             'type'        => 'checkbox',
147
-                                            'label'       => apply_filters( 'wpinv_name_your_price_toggle_text', __( 'Let customers name their price', 'invoicing' ) ),
147
+                                            'label'       => apply_filters('wpinv_name_your_price_toggle_text', __('Let customers name their price', 'invoicing')),
148 148
                                             'value'       => '1',
149 149
                                             'checked'     => $item->user_can_set_their_price(),
150 150
                                             'no_wrap'     => true,
151 151
                                         )
152 152
                                     );
153 153
 
154
-                                    do_action( 'wpinv_item_details_metabox_dynamic_pricing_checkbox', $item );
154
+                                    do_action('wpinv_item_details_metabox_dynamic_pricing_checkbox', $item);
155 155
 
156 156
                                 }
157 157
 
158 158
                                 // Subscriptions.
159
-                                do_action( 'wpinv_item_details_metabox_before_subscription_checkbox', $item );
159
+                                do_action('wpinv_item_details_metabox_before_subscription_checkbox', $item);
160 160
                                 echo aui()->input(
161 161
                                     array(
162 162
                                         'id'          => 'wpinv_is_recurring',
163 163
                                         'name'        => 'wpinv_is_recurring',
164 164
                                         'type'        => 'checkbox',
165
-                                        'label'       => apply_filters( 'wpinv_is_recurring_toggle_text', __( 'Charge customers a recurring amount for this item', 'invoicing' ) ),
165
+                                        'label'       => apply_filters('wpinv_is_recurring_toggle_text', __('Charge customers a recurring amount for this item', 'invoicing')),
166 166
                                         'value'       => '1',
167 167
                                         'checked'     => $item->is_recurring(),
168 168
                                         'no_wrap'     => true,
169 169
                                     )
170 170
                                 );
171
-                                do_action( 'wpinv_item_details_metabox_subscription_checkbox', $item );
171
+                                do_action('wpinv_item_details_metabox_subscription_checkbox', $item);
172 172
 
173 173
                             ?>
174 174
                             <div class="wpinv_show_if_recurring">
@@ -178,30 +178,30 @@  discard block
 block discarded – undo
178 178
                     </div>
179 179
                 </div>
180 180
                 <div class="col-sm-1 pt-2 pl-0">
181
-                    <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>
181
+                    <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>
182 182
                 </div>
183 183
             </div>
184
-            <?php do_action( 'wpinv_item_details_metabox_after_price', $item ); ?>
184
+            <?php do_action('wpinv_item_details_metabox_after_price', $item); ?>
185 185
 
186
-            <?php if( $item->supports_dynamic_pricing() ) : ?>
187
-                <?php do_action( 'wpinv_item_details_metabox_before_minimum_price', $item ); ?>
186
+            <?php if ($item->supports_dynamic_pricing()) : ?>
187
+                <?php do_action('wpinv_item_details_metabox_before_minimum_price', $item); ?>
188 188
                 <div class="wpinv_show_if_dynamic wpinv_minimum_price">
189 189
 
190 190
                     <div class="form-group row">
191 191
                         <label for="wpinv_minimum_price" class="col-sm-3 col-form-label">
192
-                            <?php _e( 'Minimum Price', 'invoicing' );?>
192
+                            <?php _e('Minimum Price', 'invoicing'); ?>
193 193
                         </label>
194 194
                         <div class="col-sm-8">
195 195
                             <div class="input-group input-group-sm">
196
-                                <?php if( 'left' == $position ) : ?>
196
+                                <?php if ('left' == $position) : ?>
197 197
                                     <div class="input-group-prepend">
198 198
                                         <span class="input-group-text" id="wpinv_item_minimum_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
199 199
                                     </div>
200 200
                                 <?php endif; ?>
201 201
 
202
-                                <input type="text" name="wpinv_minimum_price" id="wpinv_minimum_price" value="<?php echo esc_attr( $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($item->get_minimum_price('edit')); ?>" placeholder="<?php echo esc_attr(wpinv_sanitize_amount(0)); ?>" class="form-control">
203 203
 
204
-                                <?php if( 'left' != $position ) : ?>
204
+                                <?php if ('left' != $position) : ?>
205 205
                                     <div class="input-group-append">
206 206
                                         <span class="input-group-text" id="wpinv_item_minimum_price_symbol"><?php echo wpinv_currency_symbol(); ?></span>
207 207
                                     </div>
@@ -210,45 +210,45 @@  discard block
 block discarded – undo
210 210
                         </div>
211 211
 
212 212
                         <div class="col-sm-1 pt-2 pl-0">
213
-                            <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>
213
+                            <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>
214 214
                         </div>
215 215
                     </div>
216 216
 
217 217
                 </div>
218
-                <?php do_action( 'wpinv_item_details_metabox_minimum_price', $item ); ?>
218
+                <?php do_action('wpinv_item_details_metabox_minimum_price', $item); ?>
219 219
             <?php endif; ?>
220 220
 
221
-            <?php do_action( 'wpinv_item_details_metabox_before_maximum_renewals', $item ); ?>
221
+            <?php do_action('wpinv_item_details_metabox_before_maximum_renewals', $item); ?>
222 222
             <div class="wpinv_show_if_recurring wpinv_maximum_renewals">
223 223
 
224 224
                 <div class="form-group row">
225 225
                     <label for="wpinv_recurring_limit" class="col-sm-3 col-form-label">
226
-                        <?php _e( 'Maximum Renewals', 'invoicing' );?>
226
+                        <?php _e('Maximum Renewals', 'invoicing'); ?>
227 227
                     </label>
228 228
                     <div class="col-sm-8">
229
-                        <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%;" />
229
+                        <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%;" />
230 230
                     </div>
231 231
                     <div class="col-sm-1 pt-2 pl-0">
232
-                        <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>
232
+                        <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>
233 233
                     </div>
234 234
                 </div>
235 235
 
236 236
             </div>
237
-            <?php do_action( 'wpinv_item_details_metabox_maximum_renewals', $item ); ?>
237
+            <?php do_action('wpinv_item_details_metabox_maximum_renewals', $item); ?>
238 238
 
239
-            <?php do_action( 'wpinv_item_details_metabox_before_free_trial', $item ); ?>
239
+            <?php do_action('wpinv_item_details_metabox_before_free_trial', $item); ?>
240 240
             <div class="wpinv_show_if_recurring wpinv_free_trial">
241 241
 
242 242
                 <div class="form-group row">
243
-                    <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php _e( 'Free Trial', 'invoicing' )?></label>
243
+                    <label class="col-sm-3 col-form-label" for="wpinv_trial_interval"><?php _e('Free Trial', 'invoicing')?></label>
244 244
 
245 245
                     <div class="col-sm-8">
246 246
                         <div class="row">
247 247
                             <div class="col-sm-6">
248
-                                <?php $value = $item->has_free_trial() ? $item->get_trial_interval( 'edit' ) : 0;?>
248
+                                <?php $value = $item->has_free_trial() ? $item->get_trial_interval('edit') : 0; ?>
249 249
 
250 250
                                 <div>
251
-                                    <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr( $value ); ?>" >
251
+                                    <input type="number" name="wpinv_trial_interval" style="width: 100%;" placeholder="0" id="wpinv_trial_interval" value="<?php echo esc_attr($value); ?>" >
252 252
                                 </div>
253 253
                             </div>
254 254
                             <div class="col-sm-6">
@@ -257,17 +257,17 @@  discard block
 block discarded – undo
257 257
                                         array(
258 258
                                             'id'               => 'wpinv_trial_period',
259 259
                                             'name'             => 'wpinv_trial_period',
260
-                                            'label'            => __( 'Trial Period', 'invoicing' ),
261
-                                            'placeholder'      => __( 'Trial Period', 'invoicing' ),
262
-                                            'value'            => $item->get_recurring_period( 'edit' ),
260
+                                            'label'            => __('Trial Period', 'invoicing'),
261
+                                            'placeholder'      => __('Trial Period', 'invoicing'),
262
+                                            'value'            => $item->get_recurring_period('edit'),
263 263
                                             'select2'          => true,
264 264
                                             'data-allow-clear' => 'false',
265 265
                                             'no_wrap'          => true,
266 266
                                             'options'          => array(
267
-                                                'D'  => __( 'day(s)', 'invoicing' ),
268
-                                                'W'  => __( 'week(s)', 'invoicing' ),
269
-                                                'M'  => __( 'month(s)', 'invoicing' ),
270
-                                                'Y'  => __( 'year(s)', 'invoicing' ),
267
+                                                'D'  => __('day(s)', 'invoicing'),
268
+                                                'W'  => __('week(s)', 'invoicing'),
269
+                                                'M'  => __('month(s)', 'invoicing'),
270
+                                                'Y'  => __('year(s)', 'invoicing'),
271 271
                                             )
272 272
                                         )
273 273
                                     );
@@ -278,15 +278,15 @@  discard block
 block discarded – undo
278 278
                     </div>
279 279
 
280 280
                     <div class="col-sm-1 pt-2 pl-0">
281
-                        <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>
281
+                        <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>
282 282
                     </div>
283 283
 
284 284
                 </div>
285 285
 
286 286
             </div>
287
-            <?php do_action( 'wpinv_item_details_metabox__free_trial', $item ); ?>
287
+            <?php do_action('wpinv_item_details_metabox__free_trial', $item); ?>
288 288
 
289
-            <?php do_action( 'wpinv_item_details_metabox_item_details', $item ); ?>
289
+            <?php do_action('wpinv_item_details_metabox_item_details', $item); ?>
290 290
         </div>
291 291
         <?php
292 292
 
@@ -297,31 +297,31 @@  discard block
 block discarded – undo
297 297
 	 *
298 298
 	 * @param int $post_id
299 299
 	 */
300
-	public static function save( $post_id ) {
300
+	public static function save($post_id) {
301 301
 
302 302
         // Prepare the item.
303
-        $item = new WPInv_Item( $post_id );
303
+        $item = new WPInv_Item($post_id);
304 304
 
305 305
         // Load new data.
306 306
         $item->set_props(
307 307
 			array(
308
-				'price'                => isset( $_POST['wpinv_item_price'] ) ? (float) $_POST['wpinv_item_price'] : null,
309
-				'vat_rule'             => isset( $_POST['wpinv_vat_rules'] ) ? wpinv_clean( $_POST['wpinv_vat_rules'] ) : null,
310
-				'vat_class'            => isset( $_POST['wpinv_vat_class'] ) ? wpinv_clean( $_POST['wpinv_vat_class'] ) : null,
311
-				'type'                 => isset( $_POST['wpinv_item_type'] ) ? wpinv_clean( $_POST['wpinv_item_type'] ) : null,
312
-				'is_dynamic_pricing'   => isset( $_POST['wpinv_name_your_price'] ),
313
-                'minimum_price'        => isset( $_POST['wpinv_minimum_price'] ) ? (float) $_POST['wpinv_minimum_price'] : null,
314
-				'is_recurring'         => isset( $_POST['wpinv_is_recurring'] ),
315
-				'recurring_period'     => isset( $_POST['wpinv_recurring_period'] ) ? wpinv_clean( $_POST['wpinv_recurring_period'] ) : null,
316
-				'recurring_interval'   => isset( $_POST['wpinv_recurring_interval'] ) ? (int) $_POST['wpinv_recurring_interval'] : null,
317
-				'recurring_limit'      => isset( $_POST['wpinv_recurring_limit'] ) ? (int) $_POST['wpinv_recurring_limit'] : null,
318
-				'is_free_trial'        => isset( $_POST['wpinv_trial_interval'] ) ? ( 0 != (int) $_POST['wpinv_trial_interval'] ) : null,
319
-				'trial_period'         => isset( $_POST['wpinv_trial_period'] ) ? wpinv_clean( $_POST['wpinv_trial_period'] ) : null,
320
-				'trial_interval'       => isset( $_POST['wpinv_trial_interval'] ) ? (int) $_POST['wpinv_trial_interval'] : null,
308
+				'price'                => isset($_POST['wpinv_item_price']) ? (float) $_POST['wpinv_item_price'] : null,
309
+				'vat_rule'             => isset($_POST['wpinv_vat_rules']) ? wpinv_clean($_POST['wpinv_vat_rules']) : null,
310
+				'vat_class'            => isset($_POST['wpinv_vat_class']) ? wpinv_clean($_POST['wpinv_vat_class']) : null,
311
+				'type'                 => isset($_POST['wpinv_item_type']) ? wpinv_clean($_POST['wpinv_item_type']) : null,
312
+				'is_dynamic_pricing'   => isset($_POST['wpinv_name_your_price']),
313
+                'minimum_price'        => isset($_POST['wpinv_minimum_price']) ? (float) $_POST['wpinv_minimum_price'] : null,
314
+				'is_recurring'         => isset($_POST['wpinv_is_recurring']),
315
+				'recurring_period'     => isset($_POST['wpinv_recurring_period']) ? wpinv_clean($_POST['wpinv_recurring_period']) : null,
316
+				'recurring_interval'   => isset($_POST['wpinv_recurring_interval']) ? (int) $_POST['wpinv_recurring_interval'] : null,
317
+				'recurring_limit'      => isset($_POST['wpinv_recurring_limit']) ? (int) $_POST['wpinv_recurring_limit'] : null,
318
+				'is_free_trial'        => isset($_POST['wpinv_trial_interval']) ? (0 != (int) $_POST['wpinv_trial_interval']) : null,
319
+				'trial_period'         => isset($_POST['wpinv_trial_period']) ? wpinv_clean($_POST['wpinv_trial_period']) : null,
320
+				'trial_interval'       => isset($_POST['wpinv_trial_interval']) ? (int) $_POST['wpinv_trial_interval'] : null,
321 321
 			)
322 322
         );
323 323
 
324 324
 		$item->save();
325
-		do_action( 'getpaid_item_metabox_save', $post_id, $item );
325
+		do_action('getpaid_item_metabox_save', $post_id, $item);
326 326
 	}
327 327
 }
Please login to merge, or discard this patch.
includes/admin/meta-boxes/class-getpaid-meta-box-invoice-address.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 if ( ! defined( 'ABSPATH' ) ) {
11
-	exit; // Exit if accessed directly
11
+    exit; // Exit if accessed directly
12 12
 }
13 13
 
14 14
 /**
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 class GetPaid_Meta_Box_Invoice_Address {
18 18
 
19 19
     /**
20
-	 * Output the metabox.
21
-	 *
22
-	 * @param WP_Post $post
23
-	 */
20
+     * Output the metabox.
21
+     *
22
+     * @param WP_Post $post
23
+     */
24 24
     public static function output( $post ) {
25 25
 
26 26
         // Prepare the invoice.
@@ -300,18 +300,18 @@  discard block
 block discarded – undo
300 300
     }
301 301
 
302 302
     /**
303
-	 * Save meta box data.
304
-	 *
305
-	 * @param int $post_id
306
-	 */
307
-	public static function save( $post_id ) {
303
+     * Save meta box data.
304
+     *
305
+     * @param int $post_id
306
+     */
307
+    public static function save( $post_id ) {
308 308
 
309 309
         // Prepare the invoice.
310 310
         $invoice = new WPInv_Invoice( $post_id );
311 311
 
312 312
         // Load new data.
313 313
         $invoice->set_props(
314
-			array(
314
+            array(
315 315
                 'template'             => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null,
316 316
                 'email_cc'             => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null,
317 317
                 'disable_taxes'        => isset( $_POST['disable_taxes'] ),
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                 'due_date'             => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null,
333 333
                 'number'               => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null,
334 334
                 'status'               => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null,
335
-			)
335
+            )
336 336
         );
337 337
 
338 338
         // Recalculate totals.
@@ -362,6 +362,6 @@  discard block
 block discarded – undo
362 362
         }
363 363
 
364 364
         // Fires after an invoice is saved.
365
-		do_action( 'wpinv_invoice_metabox_saved', $invoice );
366
-	}
365
+        do_action( 'wpinv_invoice_metabox_saved', $invoice );
366
+    }
367 367
 }
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 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,12 +21,12 @@  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 invoice.
27
-        $invoice = new WPInv_Invoice( $post );
27
+        $invoice = new WPInv_Invoice($post);
28 28
 
29
-        wp_nonce_field( 'getpaid_meta_nonce', 'getpaid_meta_nonce' );
29
+        wp_nonce_field('getpaid_meta_nonce', 'getpaid_meta_nonce');
30 30
 
31 31
         ?>
32 32
 
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
                         <div class="col-12 col-sm-6">
43 43
                             <div id="getpaid-invoice-user-id-wrapper" class="form-group">
44 44
                                 <div>
45
-                                    <label for="post_author_override"><?php _e( 'Customer', 'invoicing' );?></label>
45
+                                    <label for="post_author_override"><?php _e('Customer', 'invoicing'); ?></label>
46 46
                                 </div>
47 47
                                 <?php 
48 48
                                     wpinv_dropdown_users(
49 49
                                         array(
50 50
                                             'name'             => 'post_author_override',
51
-                                            'selected'         => $invoice->get_id() ? $invoice->get_user_id( 'edit' ) : get_current_user_id(),
51
+                                            'selected'         => $invoice->get_id() ? $invoice->get_user_id('edit') : get_current_user_id(),
52 52
                                             'include_selected' => true,
53 53
                                             'show'             => 'display_name_with_email',
54 54
                                             'orderby'          => 'user_email',
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                                             'type'        => 'text',
67 67
                                             'id'          => 'getpaid-invoice-new-user-email',
68 68
                                             'name'        => 'wpinv_email',
69
-                                            'label'       => __( 'Email', 'invoicing' ) . '<span class="required">*</span>',
69
+                                            'label'       => __('Email', 'invoicing') . '<span class="required">*</span>',
70 70
                                             'label_type'  => 'vertical',
71 71
                                             'placeholder' => '[email protected]',
72 72
                                             'class'       => 'form-control-sm',
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
76 76
                             </div>
77 77
                         </div>
78 78
                         <div class="col-12 col-sm-6 form-group mt-sm-4">
79
-                            <?php if ( ! $invoice->is_paid() && ! $invoice->is_refunded() ) : ?>
79
+                            <?php if (!$invoice->is_paid() && !$invoice->is_refunded()) : ?>
80 80
                                 <a id="getpaid-invoice-fill-user-details" class="button button-small button-secondary" href="javascript:void(0)">
81 81
                                     <i aria-hidden="true" class="fa fa-refresh"></i>
82
-                                    <?php _e( 'Fill User Details', 'invoicing' );?>
82
+                                    <?php _e('Fill User Details', 'invoicing'); ?>
83 83
                                 </a>
84 84
                                 <a id="getpaid-invoice-create-new-user-button" class="button button-small button-secondary" href="javascript:void(0)">
85 85
                                     <i aria-hidden="true" class="fa fa-plus"></i>
86
-                                    <?php _e( 'Add New User', 'invoicing' );?>
86
+                                    <?php _e('Add New User', 'invoicing'); ?>
87 87
                                 </a>
88 88
                                 <a id="getpaid-invoice-cancel-create-new-user" class="button button-small button-secondary d-none" href="javascript:void(0)">
89 89
                                     <i aria-hidden="true" class="fa fa-close"></i>
90
-                                    <?php _e( 'Cancel', 'invoicing' );?>
90
+                                    <?php _e('Cancel', 'invoicing'); ?>
91 91
                                 </a>
92 92
                             <?php endif; ?>
93 93
                         </div>
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
                                         'type'        => 'text',
101 101
                                         'id'          => 'wpinv_first_name',
102 102
                                         'name'        => 'wpinv_first_name',
103
-                                        'label'       => __( 'First Name', 'invoicing' ),
103
+                                        'label'       => __('First Name', 'invoicing'),
104 104
                                         'label_type'  => 'vertical',
105 105
                                         'placeholder' => 'Jane',
106 106
                                         'class'       => 'form-control-sm',
107
-                                        'value'       => $invoice->get_first_name( 'edit' ),
107
+                                        'value'       => $invoice->get_first_name('edit'),
108 108
                                     )
109 109
                                 );
110 110
                             ?>
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
                                         'type'        => 'text',
117 117
                                         'id'          => 'wpinv_last_name',
118 118
                                         'name'        => 'wpinv_last_name',
119
-                                        'label'       => __( 'Last Name', 'invoicing' ),
119
+                                        'label'       => __('Last Name', 'invoicing'),
120 120
                                         'label_type'  => 'vertical',
121 121
                                         'placeholder' => 'Doe',
122 122
                                         'class'       => 'form-control-sm',
123
-                                        'value'       => $invoice->get_last_name( 'edit' ),
123
+                                        'value'       => $invoice->get_last_name('edit'),
124 124
                                     )
125 125
                                 );
126 126
                             ?>
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
                                         'type'        => 'text',
136 136
                                         'id'          => 'wpinv_company',
137 137
                                         'name'        => 'wpinv_company',
138
-                                        'label'       => __( 'Company', 'invoicing' ),
138
+                                        'label'       => __('Company', 'invoicing'),
139 139
                                         'label_type'  => 'vertical',
140 140
                                         'placeholder' => 'Acme Corporation',
141 141
                                         'class'       => 'form-control-sm',
142
-                                        'value'       => $invoice->get_company( 'edit' ),
142
+                                        'value'       => $invoice->get_company('edit'),
143 143
                                     )
144 144
                                 );
145 145
                             ?>
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
                                         'type'        => 'text',
152 152
                                         'id'          => 'wpinv_vat_number',
153 153
                                         'name'        => 'wpinv_vat_number',
154
-                                        'label'       => __( 'Vat Number', 'invoicing' ),
154
+                                        'label'       => __('Vat Number', 'invoicing'),
155 155
                                         'label_type'  => 'vertical',
156 156
                                         'placeholder' => '1234567890',
157 157
                                         'class'       => 'form-control-sm',
158
-                                        'value'       => $invoice->get_vat_number( 'edit' ),
158
+                                        'value'       => $invoice->get_vat_number('edit'),
159 159
                                     )
160 160
                                 );
161 161
                             ?>
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
                                         'type'        => 'text',
171 171
                                         'id'          => 'wpinv_address',
172 172
                                         'name'        => 'wpinv_address',
173
-                                        'label'       => __( 'Address', 'invoicing' ),
173
+                                        'label'       => __('Address', 'invoicing'),
174 174
                                         'label_type'  => 'vertical',
175 175
                                         'placeholder' => 'Blekersdijk 295',
176 176
                                         'class'       => 'form-control-sm',
177
-                                        'value'       => $invoice->get_address( 'edit' ),
177
+                                        'value'       => $invoice->get_address('edit'),
178 178
                                     )
179 179
                                 );
180 180
                             ?>
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
                                         'type'        => 'text',
187 187
                                         'id'          => 'wpinv_city',
188 188
                                         'name'        => 'wpinv_city',
189
-                                        'label'       => __( 'City', 'invoicing' ),
189
+                                        'label'       => __('City', 'invoicing'),
190 190
                                         'label_type'  => 'vertical',
191 191
                                         'placeholder' => 'Dolembreux',
192 192
                                         'class'       => 'form-control-sm',
193
-                                        'value'       => $invoice->get_vat_number( 'edit' ),
193
+                                        'value'       => $invoice->get_vat_number('edit'),
194 194
                                     )
195 195
                                 );
196 196
                             ?>
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
                                     array(
205 205
                                         'id'          => 'wpinv_country',
206 206
                                         'name'        => 'wpinv_country',
207
-                                        'label'       => __( 'Country', 'invoicing' ),
207
+                                        'label'       => __('Country', 'invoicing'),
208 208
                                         'label_type'  => 'vertical',
209
-                                        'placeholder' => __( 'Choose a country', 'invoicing' ),
209
+                                        'placeholder' => __('Choose a country', 'invoicing'),
210 210
                                         'class'       => 'form-control-sm',
211
-                                        'value'       => $invoice->get_country( 'edit' ),
211
+                                        'value'       => $invoice->get_country('edit'),
212 212
                                         'options'     => wpinv_get_country_list(),
213 213
                                         'data-allow-clear' => 'false',
214 214
                                         'select2'          => true,
@@ -219,20 +219,20 @@  discard block
 block discarded – undo
219 219
                         <div class="col-12 col-sm-6">
220 220
                             <?php
221 221
 
222
-                                $states = wpinv_get_country_states( $invoice->get_country( 'edit' ) );
222
+                                $states = wpinv_get_country_states($invoice->get_country('edit'));
223 223
 
224
-                                if ( empty( $states ) ) {
224
+                                if (empty($states)) {
225 225
 
226 226
                                     echo aui()->input(
227 227
                                         array(
228 228
                                             'type'        => 'text',
229 229
                                             'id'          => 'wpinv_state',
230 230
                                             'name'        => 'wpinv_state',
231
-                                            'label'       => __( 'State', 'invoicing' ),
231
+                                            'label'       => __('State', 'invoicing'),
232 232
                                             'label_type'  => 'vertical',
233 233
                                             'placeholder' => 'Liège',
234 234
                                             'class'       => 'form-control-sm',
235
-                                            'value'       => $invoice->get_state( 'edit' ),
235
+                                            'value'       => $invoice->get_state('edit'),
236 236
                                         )
237 237
                                     );
238 238
 
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
                                         array(
243 243
                                             'id'          => 'wpinv_state',
244 244
                                             'name'        => 'wpinv_state',
245
-                                            'label'       => __( 'State', 'invoicing' ),
245
+                                            'label'       => __('State', 'invoicing'),
246 246
                                             'label_type'  => 'vertical',
247
-                                            'placeholder' => __( 'Select a state', 'invoicing' ),
247
+                                            'placeholder' => __('Select a state', 'invoicing'),
248 248
                                             'class'       => 'form-control-sm',
249
-                                            'value'       => $invoice->get_state( 'edit' ),
249
+                                            'value'       => $invoice->get_state('edit'),
250 250
                                             'options'     => $states,
251 251
                                             'data-allow-clear' => 'false',
252 252
                                             'select2'          => true,
@@ -267,11 +267,11 @@  discard block
 block discarded – undo
267 267
                                         'type'        => 'text',
268 268
                                         'id'          => 'wpinv_zip',
269 269
                                         'name'        => 'wpinv_zip',
270
-                                        'label'       => __( 'Zip / Postal Code', 'invoicing' ),
270
+                                        'label'       => __('Zip / Postal Code', 'invoicing'),
271 271
                                         'label_type'  => 'vertical',
272 272
                                         'placeholder' => '4140',
273 273
                                         'class'       => 'form-control-sm',
274
-                                        'value'       => $invoice->get_zip( 'edit' ),
274
+                                        'value'       => $invoice->get_zip('edit'),
275 275
                                     )
276 276
                                 );
277 277
                             ?>
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
                                         'type'        => 'text',
284 284
                                         'id'          => 'wpinv_phone',
285 285
                                         'name'        => 'wpinv_phone',
286
-                                        'label'       => __( 'Phone', 'invoicing' ),
286
+                                        'label'       => __('Phone', 'invoicing'),
287 287
                                         'label_type'  => 'vertical',
288 288
                                         'placeholder' => '0493 18 45822',
289 289
                                         'class'       => 'form-control-sm',
290
-                                        'value'       => $invoice->get_phone( 'edit' ),
290
+                                        'value'       => $invoice->get_phone('edit'),
291 291
                                     )
292 292
                                 );
293 293
                             ?>
@@ -304,34 +304,34 @@  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 invoice.
310
-        $invoice = new WPInv_Invoice( $post_id );
310
+        $invoice = new WPInv_Invoice($post_id);
311 311
 
312 312
         // Load new data.
313 313
         $invoice->set_props(
314 314
 			array(
315
-                'template'             => isset( $_POST['wpinv_template'] ) ? wpinv_clean( $_POST['wpinv_template'] ) : null,
316
-                'email_cc'             => isset( $_POST['wpinv_cc'] ) ? wpinv_clean( $_POST['wpinv_cc'] ) : null,
317
-                'disable_taxes'        => isset( $_POST['disable_taxes'] ),
318
-                'currency'             => isset( $_POST['wpinv_currency'] ) ? wpinv_clean( $_POST['wpinv_currency'] ) : null,
319
-                'gateway'              => isset( $_POST['wpinv_gateway'] ) ? wpinv_clean( $_POST['wpinv_gateway'] ) : null,
320
-                'address'              => isset( $_POST['wpinv_address'] ) ? wpinv_clean( $_POST['wpinv_address'] ) : null,
321
-                'vat_number'           => isset( $_POST['wpinv_vat_number'] ) ? wpinv_clean( $_POST['wpinv_vat_number'] ) : null,
322
-                'company'              => isset( $_POST['wpinv_company'] ) ? wpinv_clean( $_POST['wpinv_company'] ) : null,
323
-                'zip'                  => isset( $_POST['wpinv_zip'] ) ? wpinv_clean( $_POST['wpinv_zip'] ) : null,
324
-                'state'                => isset( $_POST['wpinv_state'] ) ? wpinv_clean( $_POST['wpinv_state'] ) : null,
325
-                'city'                 => isset( $_POST['wpinv_city'] ) ? wpinv_clean( $_POST['wpinv_city'] ) : null,
326
-                'country'              => isset( $_POST['wpinv_country'] ) ? wpinv_clean( $_POST['wpinv_country'] ) : null,
327
-                'phone'                => isset( $_POST['wpinv_phone'] ) ? wpinv_clean( $_POST['wpinv_phone'] ) : null,
328
-                'first_name'           => isset( $_POST['wpinv_first_name'] ) ? wpinv_clean( $_POST['wpinv_first_name'] ) : null,
329
-                'last_name'            => isset( $_POST['wpinv_last_name'] ) ? wpinv_clean( $_POST['wpinv_last_name'] ) : null,
330
-                'author'               => isset( $_POST['post_author_override'] ) ? wpinv_clean( $_POST['post_author_override'] ) : null,
331
-                'date_created'         => isset( $_POST['date_created'] ) ? wpinv_clean( $_POST['date_created'] ) : null,
332
-                'due_date'             => isset( $_POST['wpinv_due_date'] ) ? wpinv_clean( $_POST['wpinv_due_date'] ) : null,
333
-                'number'               => isset( $_POST['wpinv_number'] ) ? wpinv_clean( $_POST['wpinv_number'] ) : null,
334
-                'status'               => isset( $_POST['wpinv_status'] ) ? wpinv_clean( $_POST['wpinv_status'] ) : null,
315
+                'template'             => isset($_POST['wpinv_template']) ? wpinv_clean($_POST['wpinv_template']) : null,
316
+                'email_cc'             => isset($_POST['wpinv_cc']) ? wpinv_clean($_POST['wpinv_cc']) : null,
317
+                'disable_taxes'        => isset($_POST['disable_taxes']),
318
+                'currency'             => isset($_POST['wpinv_currency']) ? wpinv_clean($_POST['wpinv_currency']) : null,
319
+                'gateway'              => isset($_POST['wpinv_gateway']) ? wpinv_clean($_POST['wpinv_gateway']) : null,
320
+                'address'              => isset($_POST['wpinv_address']) ? wpinv_clean($_POST['wpinv_address']) : null,
321
+                'vat_number'           => isset($_POST['wpinv_vat_number']) ? wpinv_clean($_POST['wpinv_vat_number']) : null,
322
+                'company'              => isset($_POST['wpinv_company']) ? wpinv_clean($_POST['wpinv_company']) : null,
323
+                'zip'                  => isset($_POST['wpinv_zip']) ? wpinv_clean($_POST['wpinv_zip']) : null,
324
+                'state'                => isset($_POST['wpinv_state']) ? wpinv_clean($_POST['wpinv_state']) : null,
325
+                'city'                 => isset($_POST['wpinv_city']) ? wpinv_clean($_POST['wpinv_city']) : null,
326
+                'country'              => isset($_POST['wpinv_country']) ? wpinv_clean($_POST['wpinv_country']) : null,
327
+                'phone'                => isset($_POST['wpinv_phone']) ? wpinv_clean($_POST['wpinv_phone']) : null,
328
+                'first_name'           => isset($_POST['wpinv_first_name']) ? wpinv_clean($_POST['wpinv_first_name']) : null,
329
+                'last_name'            => isset($_POST['wpinv_last_name']) ? wpinv_clean($_POST['wpinv_last_name']) : null,
330
+                'author'               => isset($_POST['post_author_override']) ? wpinv_clean($_POST['post_author_override']) : null,
331
+                'date_created'         => isset($_POST['date_created']) ? wpinv_clean($_POST['date_created']) : null,
332
+                'due_date'             => isset($_POST['wpinv_due_date']) ? wpinv_clean($_POST['wpinv_due_date']) : null,
333
+                'number'               => isset($_POST['wpinv_number']) ? wpinv_clean($_POST['wpinv_number']) : null,
334
+                'status'               => isset($_POST['wpinv_status']) ? wpinv_clean($_POST['wpinv_status']) : null,
335 335
 			)
336 336
         );
337 337
 
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
         $invoice->recalculate_total();
340 340
 
341 341
         // If we're creating a new user...
342
-        if ( ! empty( $_POST['wpinv_new_user'] ) && is_email( $_POST['wpinv_email'] ) ) {
342
+        if (!empty($_POST['wpinv_new_user']) && is_email($_POST['wpinv_email'])) {
343 343
 
344 344
             // Attempt to create the user.
345
-            $user = wpinv_create_user( sanitize_email( $_POST['wpinv_email'] ) );
345
+            $user = wpinv_create_user(sanitize_email($_POST['wpinv_email']));
346 346
 
347 347
 
348 348
             // If successful, update the invoice author.
349
-            if ( is_numeric( $user ) ) {
350
-                $invoice->set_author( $user );
349
+            if (is_numeric($user)) {
350
+                $invoice->set_author($user);
351 351
             } else {
352
-                wpinv_error_log( $user->get_error_message(), __( 'Invoice add new user', 'invoicing' ), __FILE__, __LINE__ );
352
+                wpinv_error_log($user->get_error_message(), __('Invoice add new user', 'invoicing'), __FILE__, __LINE__);
353 353
             }
354 354
         }
355 355
 
@@ -357,11 +357,11 @@  discard block
 block discarded – undo
357 357
         $invoice->save();
358 358
 
359 359
         // (Maybe) send new user notification.
360
-        if ( ! empty( $user ) && is_numeric( $user ) && apply_filters( 'getpaid_send_new_user_notification', true ) ) {
361
-            wp_send_new_user_notifications( $user, 'user' );
360
+        if (!empty($user) && is_numeric($user) && apply_filters('getpaid_send_new_user_notification', true)) {
361
+            wp_send_new_user_notifications($user, 'user');
362 362
         }
363 363
 
364 364
         // Fires after an invoice is saved.
365
-		do_action( 'wpinv_invoice_metabox_saved', $invoice );
365
+		do_action('wpinv_invoice_metabox_saved', $invoice);
366 366
 	}
367 367
 }
Please login to merge, or discard this patch.
templates/invoice/footer.php 1 patch
Spacing   +4 added lines, -4 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
 ?>
13 13
 
14 14
     <div class="border-top pt-4 bg-white">
15 15
         <div class="container pr-0 pl-0">
16 16
 
17
-            <?php if ( $term_text = wpinv_get_terms_text() ) : ?>
17
+            <?php if ($term_text = wpinv_get_terms_text()) : ?>
18 18
                 <div class="terms-text">
19
-                    <?php echo wpautop( $term_text ); ?>
19
+                    <?php echo wpautop($term_text); ?>
20 20
                 </div>
21 21
             <?php endif; ?>
22 22
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
             </div>
26 26
 
27 27
             <div class="print-only">
28
-                <?php _e( 'Page ', 'invoicing' ) ?> {PAGENO}/{nbpg}
28
+                <?php _e('Page ', 'invoicing') ?> {PAGENO}/{nbpg}
29 29
             </div>
30 30
 
31 31
         </div>
Please login to merge, or discard this patch.
templates/invoice/billing-address.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  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
-$invoice     = new WPInv_Invoice( $invoice );
13
-$address_row = wpinv_get_invoice_address_markup( $invoice->get_user_info() );
12
+$invoice     = new WPInv_Invoice($invoice);
13
+$address_row = wpinv_get_invoice_address_markup($invoice->get_user_info());
14 14
 $phone       = $invoice->get_phone();
15 15
 $email       = $invoice->get_email();
16 16
 
@@ -21,36 +21,36 @@  discard block
 block discarded – undo
21 21
 
22 22
 
23 23
             <div class="invoice-billing-address-label col-2">
24
-                <strong><?php _e( 'To:', 'invoicing' ) ?></strong>
24
+                <strong><?php _e('To:', 'invoicing') ?></strong>
25 25
             </div>
26 26
 
27 27
 
28 28
             <div class="invoice-billing-address-value col-10">
29 29
 
30
-                <?php do_action( 'getpaid_billing_address_top' ); ?>
30
+                <?php do_action('getpaid_billing_address_top'); ?>
31 31
 
32
-                <?php if ( ! empty( $address_row ) ) : ?>
32
+                <?php if (!empty($address_row)) : ?>
33 33
                     <div class="billing-address">
34 34
                         <?php echo $address_row; ?>
35 35
                     </div>
36 36
                 <?php endif; ?>
37 37
 
38 38
 
39
-                <?php if ( ! empty( $phone ) ) : ?>
39
+                <?php if (!empty($phone)) : ?>
40 40
                     <div class="billing-phone">
41
-                        <?php echo wp_sprintf( __( 'Phone: %s', 'invoicing' ), esc_html( $phone ) ); ?>
41
+                        <?php echo wp_sprintf(__('Phone: %s', 'invoicing'), esc_html($phone)); ?>
42 42
                     </div>
43 43
                 <?php endif; ?>
44 44
 
45 45
 
46
-                <?php if ( ! empty( $email ) ) : ?>
46
+                <?php if (!empty($email)) : ?>
47 47
                     <div class="billing-email">
48
-                        <?php echo wp_sprintf( __( 'Email: %s', 'invoicing' ), sanitize_email( $email ) ); ?>
48
+                        <?php echo wp_sprintf(__('Email: %s', 'invoicing'), sanitize_email($email)); ?>
49 49
                     </div>
50 50
                 <?php endif; ?>
51 51
 
52 52
 
53
-                <?php do_action( 'getpaid_billing_address_bottom' ); ?>
53
+                <?php do_action('getpaid_billing_address_bottom'); ?>
54 54
 
55 55
             </div>
56 56
 
Please login to merge, or discard this patch.
templates/invoice/header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  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
 ?>
13 13
 
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
             <div class="row">
17 17
 
18 18
                 <div class="col-12 col-sm-6 text-left pl-0">
19
-                    <?php do_action( 'getpaid_invoice_header_left', $invoice );?>
19
+                    <?php do_action('getpaid_invoice_header_left', $invoice); ?>
20 20
                 </div>
21 21
 
22 22
                 <div class="col-12 col-sm-6 text-right pr-0">
23
-                    <?php do_action( 'getpaid_invoice_header_right', $invoice );?>
23
+                    <?php do_action('getpaid_invoice_header_right', $invoice); ?>
24 24
                 </div>
25 25
 
26 26
             </div>
Please login to merge, or discard this patch.