Passed
Push — master ( faf467...a86610 )
by Brian
05:04
created
includes/data/sample-payment-form-items.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
  * @version 1.0.19
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 return array(
14 14
 
Please login to merge, or discard this patch.
includes/data/sample-payment-form.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @version 1.0.19
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13 13
 return array(
14 14
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
         'placeholder' => '[email protected]',
18 18
         'value'       => '',
19
-        'label'       => __( 'Billing Email', 'invoicing' ),
19
+        'label'       => __('Billing Email', 'invoicing'),
20 20
         'description' => '',
21 21
         'required'    => true,
22 22
         'id'          => 'mmdwqzpox',
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 
42 42
         'value'       =>'',
43 43
         'class'       => 'btn-primary',
44
-        'label'       => __( 'Pay Now »', 'invoicing' ),
45
-        'description' => __( 'By continuing with your payment, you are agreeing to our privacy policy and terms of service.', 'invoicing' ),
44
+        'label'       => __('Pay Now »', 'invoicing'),
45
+        'description' => __('By continuing with your payment, you are agreeing to our privacy policy and terms of service.', 'invoicing'),
46 46
         'id'          => 'rtqljyy',
47 47
         'name'        => 'rtqljyy',
48 48
         'type'        => 'pay_button',
Please login to merge, or discard this patch.
includes/class-wpinv-payment-form-elements.php 1 patch
Spacing   +504 added lines, -504 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if ( ! defined( 'ABSPATH' ) ) {
3
+if (!defined('ABSPATH')) {
4 4
     exit; // Exit if accessed directly
5 5
 }
6 6
 
@@ -13,19 +13,19 @@  discard block
 block discarded – undo
13 13
 
14 14
     public function __construct() {
15 15
 
16
-        foreach( $this->get_elements() as $element ) {
16
+        foreach ($this->get_elements() as $element) {
17 17
             $element = $element['type'];
18 18
 
19
-            if ( method_exists( $this, "render_{$element}_template" ) ) {
20
-                add_action( 'wpinv_payment_form_render_element_template', array( $this, "render_{$element}_template" ), 10, 2 );
19
+            if (method_exists($this, "render_{$element}_template")) {
20
+                add_action('wpinv_payment_form_render_element_template', array($this, "render_{$element}_template"), 10, 2);
21 21
             }
22 22
 
23
-            if ( method_exists( $this, "edit_{$element}_template" ) ) {
24
-                add_action( 'wpinv_payment_form_edit_element_template', array( $this, "edit_{$element}_template" ), 10, 2 );
23
+            if (method_exists($this, "edit_{$element}_template")) {
24
+                add_action('wpinv_payment_form_edit_element_template', array($this, "edit_{$element}_template"), 10, 2);
25 25
             }
26 26
 
27
-            if ( method_exists( $this, "frontend_render_{$element}_template" ) ) {
28
-                add_action( "wpinv_frontend_render_payment_form_$element", array( $this, "frontend_render_{$element}_template" ), 10, 3 );
27
+            if (method_exists($this, "frontend_render_{$element}_template")) {
28
+                add_action("wpinv_frontend_render_payment_form_$element", array($this, "frontend_render_{$element}_template"), 10, 3);
29 29
             }
30 30
 
31 31
         }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function get_elements() {
39 39
 
40
-        if ( ! empty( $this->elements ) ) {
40
+        if (!empty($this->elements)) {
41 41
             return $this->elements;
42 42
         }
43 43
 
@@ -45,28 +45,28 @@  discard block
 block discarded – undo
45 45
 
46 46
             array(
47 47
                 'type'     => 'heading',
48
-                'name'     => __( 'Heading', 'invoicing' ),
48
+                'name'     => __('Heading', 'invoicing'),
49 49
                 'defaults' => array(
50 50
                     'level' => 'h2',
51
-                    'text'  => __( 'Heading', 'invoicing' ),
51
+                    'text'  => __('Heading', 'invoicing'),
52 52
                 )
53 53
             ),
54 54
 
55 55
             array(
56 56
                 'type' => 'paragraph',
57
-                'name' => __( 'Paragraph', 'invoicing' ),
57
+                'name' => __('Paragraph', 'invoicing'),
58 58
                 'defaults'  => array(
59
-                    'text'  => __( 'Paragraph text', 'invoicing' ),
59
+                    'text'  => __('Paragraph text', 'invoicing'),
60 60
                 )
61 61
             ),
62 62
 
63 63
             array( 
64 64
                 'type' => 'alert',
65
-                'name' => __( 'Alert', 'invoicing' ),
65
+                'name' => __('Alert', 'invoicing'),
66 66
                 'defaults'  => array(
67 67
                     'value'        => '',
68 68
                     'class'        => 'alert-warning',
69
-                    'text'         => __( 'Alert', 'invoicing' ),
69
+                    'text'         => __('Alert', 'invoicing'),
70 70
                     'dismissible'  => false,
71 71
                 )
72 72
             ),
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 
83 83
             array(
84 84
                 'type' => 'text',
85
-                'name' => __( 'Text Input', 'invoicing' ),
85
+                'name' => __('Text Input', 'invoicing'),
86 86
                 'defaults'  => array(
87
-                    'placeholder'  => __( 'Enter some text', 'invoicing' ),
87
+                    'placeholder'  => __('Enter some text', 'invoicing'),
88 88
                     'value'        => '',
89
-                    'label'        => __( 'Field Label', 'invoicing' ),
89
+                    'label'        => __('Field Label', 'invoicing'),
90 90
                     'description'  => '',
91 91
                     'required'     => false,
92 92
                 )
@@ -94,11 +94,11 @@  discard block
 block discarded – undo
94 94
 
95 95
             array(
96 96
                 'type' => 'textarea',
97
-                'name' => __( 'Textarea', 'invoicing' ),
97
+                'name' => __('Textarea', 'invoicing'),
98 98
                 'defaults'         => array(
99
-                    'placeholder'  => __( 'Enter your text hear', 'invoicing' ),
99
+                    'placeholder'  => __('Enter your text hear', 'invoicing'),
100 100
                     'value'        => '',
101
-                    'label'        => __( 'Textarea Label', 'invoicing' ),
101
+                    'label'        => __('Textarea Label', 'invoicing'),
102 102
                     'description'  => '',
103 103
                     'required'     => false,
104 104
                 )
@@ -106,27 +106,27 @@  discard block
 block discarded – undo
106 106
 
107 107
             array(
108 108
                 'type' => 'select',
109
-                'name' => __( 'Dropdown', 'invoicing' ),
109
+                'name' => __('Dropdown', 'invoicing'),
110 110
                 'defaults'         => array(
111
-                    'placeholder'  => __( 'Select a value', 'invoicing' ),
111
+                    'placeholder'  => __('Select a value', 'invoicing'),
112 112
                     'value'        => '',
113
-                    'label'        => __( 'Dropdown Label', 'invoicing' ),
113
+                    'label'        => __('Dropdown Label', 'invoicing'),
114 114
                     'description'  => '',
115 115
                     'required'     => false,
116 116
                     'options'      => array(
117
-                        esc_attr__( 'Option One', 'invoicing' ),
118
-                        esc_attr__( 'Option Two', 'invoicing' ),
119
-                        esc_attr__( 'Option Three', 'invoicing' )
117
+                        esc_attr__('Option One', 'invoicing'),
118
+                        esc_attr__('Option Two', 'invoicing'),
119
+                        esc_attr__('Option Three', 'invoicing')
120 120
                     ),
121 121
                 )
122 122
             ),
123 123
 
124 124
             array(
125 125
                 'type' => 'checkbox',
126
-                'name' => __( 'Checkbox', 'invoicing' ),
126
+                'name' => __('Checkbox', 'invoicing'),
127 127
                 'defaults'         => array(
128 128
                     'value'        => '',
129
-                    'label'        => __( 'Checkbox Label', 'invoicing' ),
129
+                    'label'        => __('Checkbox Label', 'invoicing'),
130 130
                     'description'  => '',
131 131
                     'required'     => false,
132 132
                 )
@@ -134,24 +134,24 @@  discard block
 block discarded – undo
134 134
 
135 135
             array( 
136 136
                 'type' => 'radio',
137
-                'name' => __( 'Multiple Choice', 'invoicing' ),
137
+                'name' => __('Multiple Choice', 'invoicing'),
138 138
                 'defaults'     => array(
139
-                    'label'    => __( 'Select one choice', 'invoicing' ),
139
+                    'label'    => __('Select one choice', 'invoicing'),
140 140
                     'options'  => array(
141
-                        esc_attr__( 'Choice One', 'invoicing' ),
142
-                        esc_attr__( 'Choice Two', 'invoicing' ),
143
-                        esc_attr__( 'Choice Three', 'invoicing' )
141
+                        esc_attr__('Choice One', 'invoicing'),
142
+                        esc_attr__('Choice Two', 'invoicing'),
143
+                        esc_attr__('Choice Three', 'invoicing')
144 144
                     ),
145 145
                 )
146 146
             ),
147 147
 
148 148
             array( 
149 149
                 'type' => 'date',
150
-                'name' => __( 'Date', 'invoicing' ),
150
+                'name' => __('Date', 'invoicing'),
151 151
                 'defaults' => array(
152 152
                     'placeholder'  => '',
153 153
                     'value'        => '',
154
-                    'label'        => __( 'Date', 'invoicing' ),
154
+                    'label'        => __('Date', 'invoicing'),
155 155
                     'description'  => '',
156 156
                     'required'     => false,
157 157
                 )
@@ -159,11 +159,11 @@  discard block
 block discarded – undo
159 159
 
160 160
             array( 
161 161
                 'type' => 'time',
162
-                'name' => __( 'Time', 'invoicing' ),
162
+                'name' => __('Time', 'invoicing'),
163 163
                 'defaults' => array(
164 164
                     'placeholder'  => '',
165 165
                     'value'        => '',
166
-                    'label'        => __( 'Time', 'invoicing' ),
166
+                    'label'        => __('Time', 'invoicing'),
167 167
                     'description'  => '',
168 168
                     'required'     => false,
169 169
                 )
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
 
172 172
             array( 
173 173
                 'type' => 'number',
174
-                'name' => __( 'Number', 'invoicing' ),
174
+                'name' => __('Number', 'invoicing'),
175 175
                 'defaults' => array(
176 176
                     'placeholder'  => '',
177 177
                     'value'        => '',
178
-                    'label'        => __( 'Number', 'invoicing' ),
178
+                    'label'        => __('Number', 'invoicing'),
179 179
                     'description'  => '',
180 180
                     'required'     => false,
181 181
                 )
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 
184 184
             array( 
185 185
                 'type' => 'website',
186
-                'name' => __( 'Website', 'invoicing' ),
186
+                'name' => __('Website', 'invoicing'),
187 187
                 'defaults' => array(
188 188
                     'placeholder'  => 'http://example.com',
189 189
                     'value'        => '',
190
-                    'label'        => __( 'Website', 'invoicing' ),
190
+                    'label'        => __('Website', 'invoicing'),
191 191
                     'description'  => '',
192 192
                     'required'     => false,
193 193
                 )
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 
196 196
             array( 
197 197
                 'type' => 'email',
198
-                'name' => __( 'Email', 'invoicing' ),
198
+                'name' => __('Email', 'invoicing'),
199 199
                 'defaults'  => array(
200 200
                     'placeholder'  => '[email protected]',
201 201
                     'value'        => '',
202
-                    'label'        => __( 'Email Address', 'invoicing' ),
202
+                    'label'        => __('Email Address', 'invoicing'),
203 203
                     'description'  => '',
204 204
                     'required'     => false,
205 205
                 )
@@ -207,14 +207,14 @@  discard block
 block discarded – undo
207 207
 
208 208
             array( 
209 209
                 'type' => 'address',
210
-                'name' => __( 'Address', 'invoicing' ),
210
+                'name' => __('Address', 'invoicing'),
211 211
                 'defaults'  => array(
212 212
 
213 213
                     'fields' => array(
214 214
                         array(
215 215
                             'placeholder'  => 'Jon',
216 216
                             'value'        => '',
217
-                            'label'        => __( 'First Name', 'invoicing' ),
217
+                            'label'        => __('First Name', 'invoicing'),
218 218
                             'description'  => '',
219 219
                             'required'     => false,
220 220
                             'visible'      => true,
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                         array(
225 225
                             'placeholder'  => 'Snow',
226 226
                             'value'        => '',
227
-                            'label'        => __( 'Last Name', 'invoicing' ),
227
+                            'label'        => __('Last Name', 'invoicing'),
228 228
                             'description'  => '',
229 229
                             'required'     => false,
230 230
                             'visible'      => true,
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                         array(
235 235
                             'placeholder'  => '',
236 236
                             'value'        => '',
237
-                            'label'        => __( 'Address', 'invoicing' ),
237
+                            'label'        => __('Address', 'invoicing'),
238 238
                             'description'  => '',
239 239
                             'required'     => false,
240 240
                             'visible'      => true,
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                         array(
245 245
                             'placeholder'  => '',
246 246
                             'value'        => '',
247
-                            'label'        => __( 'City', 'invoicing' ),
247
+                            'label'        => __('City', 'invoicing'),
248 248
                             'description'  => '',
249 249
                             'required'     => false,
250 250
                             'visible'      => true,
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                         array(
255 255
                             'placeholder'  => '',
256 256
                             'value'        => '',
257
-                            'label'        => __( 'Country', 'invoicing' ),
257
+                            'label'        => __('Country', 'invoicing'),
258 258
                             'description'  => '',
259 259
                             'required'     => false,
260 260
                             'visible'      => true,
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
                         ),
263 263
 
264 264
                         array(
265
-                            'placeholder'  => __( 'Choose a state', 'invoicing' ),
265
+                            'placeholder'  => __('Choose a state', 'invoicing'),
266 266
                             'value'        => '',
267
-                            'label'        => __( 'State / Province', 'invoicing' ),
267
+                            'label'        => __('State / Province', 'invoicing'),
268 268
                             'description'  => '',
269 269
                             'required'     => false,
270 270
                             'visible'      => true,
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                         array(
275 275
                             'placeholder'  => '',
276 276
                             'value'        => '',
277
-                            'label'        => __( 'ZIP / Postcode', 'invoicing' ),
277
+                            'label'        => __('ZIP / Postcode', 'invoicing'),
278 278
                             'description'  => '',
279 279
                             'required'     => false,
280 280
                             'visible'      => true,
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                         array(
285 285
                             'placeholder'  => '',
286 286
                             'value'        => '',
287
-                            'label'        => __( 'Phone', 'invoicing' ),
287
+                            'label'        => __('Phone', 'invoicing'),
288 288
                             'description'  => '',
289 289
                             'required'     => false,
290 290
                             'visible'      => true,
@@ -296,11 +296,11 @@  discard block
 block discarded – undo
296 296
 
297 297
             array( 
298 298
                 'type' => 'billing_email',
299
-                'name' => __( 'Billing Email', 'invoicing' ),
299
+                'name' => __('Billing Email', 'invoicing'),
300 300
                 'defaults'  => array(
301 301
                     'placeholder'  => '[email protected]',
302 302
                     'value'        => '',
303
-                    'label'        => __( 'Billing Email', 'invoicing' ),
303
+                    'label'        => __('Billing Email', 'invoicing'),
304 304
                     'description'  => '',
305 305
                     'premade'      => true,
306 306
                 )
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
             array( 
321 321
                 'type' => 'items',
322
-                'name' => __( 'Items', 'invoicing' ),
322
+                'name' => __('Items', 'invoicing'),
323 323
                 'defaults'  => array(
324 324
                     'value'        => '',
325 325
                     'items_type'   => 'total',
@@ -330,25 +330,25 @@  discard block
 block discarded – undo
330 330
 
331 331
             array( 
332 332
                 'type'       => 'pay_button',
333
-                'name'       => __( 'Payment Button', 'invoicing' ),
333
+                'name'       => __('Payment Button', 'invoicing'),
334 334
                 'defaults'   => array(
335 335
                     'value'        => '',
336 336
                     'class'        => 'btn-primary',
337
-                    'label'        => __( 'Pay Now »', 'invoicing' ),
338
-                    'description'  => __( 'By continuing with our payment, you are agreeing to our privacy policy and terms of service.', 'invoicing' ),
337
+                    'label'        => __('Pay Now »', 'invoicing'),
338
+                    'description'  => __('By continuing with our payment, you are agreeing to our privacy policy and terms of service.', 'invoicing'),
339 339
                     'premade'      => true,
340 340
                 )
341 341
             )
342 342
         );
343 343
 
344
-        $this->elements = apply_filters( 'wpinv_filter_core_payment_form_elements', $this->elements );
344
+        $this->elements = apply_filters('wpinv_filter_core_payment_form_elements', $this->elements);
345 345
         return $this->elements;
346 346
     }
347 347
 
348 348
     /**
349 349
      * Returns the restrict markup.
350 350
      */
351
-    public function get_restrict_markup( $field, $field_type ) {
351
+    public function get_restrict_markup($field, $field_type) {
352 352
         $restrict = "$field.type=='$field_type'";
353 353
         return "v-if=\"$restrict\"";
354 354
     }
@@ -356,15 +356,15 @@  discard block
 block discarded – undo
356 356
     /**
357 357
      * Renders the title element template.
358 358
      */
359
-    public function render_heading_template( $field ) {
360
-        $restrict = $this->get_restrict_markup( $field, 'heading' );
359
+    public function render_heading_template($field) {
360
+        $restrict = $this->get_restrict_markup($field, 'heading');
361 361
         echo "<component :is='$field.level' $restrict v-html='$field.text'></component>";
362 362
     }
363 363
 
364 364
     /**
365 365
      * Renders the title element on the frontend.
366 366
      */
367
-    public function frontend_render_heading_template( $field ) {
367
+    public function frontend_render_heading_template($field) {
368 368
         $tag = $field['level'];
369 369
         echo "<$tag>{$field['text']}</$tag>";
370 370
     }
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
     /**
373 373
      * Renders the edit title element template.
374 374
      */
375
-    public function edit_heading_template( $field ) {
376
-        $restrict = $this->get_restrict_markup( $field, 'heading' );
377
-        $label    = __( 'Heading', 'invoicing' );
378
-        $label2   = __( 'Select Heading Level', 'invoicing' );
375
+    public function edit_heading_template($field) {
376
+        $restrict = $this->get_restrict_markup($field, 'heading');
377
+        $label    = __('Heading', 'invoicing');
378
+        $label2   = __('Select Heading Level', 'invoicing');
379 379
         $id       = $field . '.id + "_edit"';
380 380
         $id2      = $field . '.id + "_edit2"';
381 381
 
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
     /**
408 408
      * Renders a paragraph element template.
409 409
      */
410
-    public function render_paragraph_template( $field ) {
411
-        $restrict = $this->get_restrict_markup( $field, 'paragraph' );
410
+    public function render_paragraph_template($field) {
411
+        $restrict = $this->get_restrict_markup($field, 'paragraph');
412 412
         $label    = "$field.text";
413 413
         echo "<p $restrict v-html='$label' style='font-size: 16px;'></p>";
414 414
     }
@@ -416,16 +416,16 @@  discard block
 block discarded – undo
416 416
     /**
417 417
      * Renders the paragraph element on the frontend.
418 418
      */
419
-    public function frontend_render_paragraph_template( $field ) {
419
+    public function frontend_render_paragraph_template($field) {
420 420
         echo "<p>{$field['text']}</p>";
421 421
     }
422 422
 
423 423
     /**
424 424
      * Renders the edit paragraph element template.
425 425
      */
426
-    public function edit_paragraph_template( $field ) {
427
-        $restrict = $this->get_restrict_markup( $field, 'paragraph' );
428
-        $label    = __( 'Enter your text', 'invoicing' );
426
+    public function edit_paragraph_template($field) {
427
+        $restrict = $this->get_restrict_markup($field, 'paragraph');
428
+        $label    = __('Enter your text', 'invoicing');
429 429
         $id       = $field . '.id + "_edit"';
430 430
         echo "
431 431
             <div $restrict>
@@ -441,8 +441,8 @@  discard block
 block discarded – undo
441 441
     /**
442 442
      * Renders the text element template.
443 443
      */
444
-    public function render_text_template( $field ) {
445
-        $restrict = $this->get_restrict_markup( $field, 'text' );
444
+    public function render_text_template($field) {
445
+        $restrict = $this->get_restrict_markup($field, 'text');
446 446
         $label    = "$field.label";
447 447
         echo "
448 448
             <div $restrict>
@@ -456,23 +456,23 @@  discard block
 block discarded – undo
456 456
     /**
457 457
      * Renders the text element on the frontend.
458 458
      */
459
-    public function frontend_render_text_template( $field ) {
459
+    public function frontend_render_text_template($field) {
460 460
         
461 461
         echo "<div class='form-group'>";
462 462
 
463 463
         echo aui()->input(
464 464
             array(
465
-                'name'       => esc_attr( $field['id'] ),
466
-                'id'         => esc_attr( $field['id'] ),
467
-                'placeholder'=> esc_attr( $field['placeholder'] ),
465
+                'name'       => esc_attr($field['id']),
466
+                'id'         => esc_attr($field['id']),
467
+                'placeholder'=> esc_attr($field['placeholder']),
468 468
                 'required'   => (bool) $field['required'],
469
-                'label'      => wp_kses_post( $field['label'] ),
469
+                'label'      => wp_kses_post($field['label']),
470 470
                 'no_wrap'    => true,
471 471
             )
472 472
         );
473 473
 
474
-        if ( ! empty( $field['description'] ) ) {
475
-            $description = wp_kses_post( $field['description'] );
474
+        if (!empty($field['description'])) {
475
+            $description = wp_kses_post($field['description']);
476 476
             echo "<small class='form-text text-muted'>$description</small>";
477 477
         }
478 478
 
@@ -483,16 +483,16 @@  discard block
 block discarded – undo
483 483
     /**
484 484
      * Renders the edit text element template.
485 485
      */
486
-    public function edit_text_template( $field ) {
487
-        $restrict = $this->get_restrict_markup( $field, 'text' );
488
-        $label    = __( 'Field Label', 'invoicing' );
486
+    public function edit_text_template($field) {
487
+        $restrict = $this->get_restrict_markup($field, 'text');
488
+        $label    = __('Field Label', 'invoicing');
489 489
         $id       = $field . '.id + "_edit"';
490
-        $label2   = __( 'Placeholder text', 'invoicing' );
490
+        $label2   = __('Placeholder text', 'invoicing');
491 491
         $id2      = $field . '.id + "_edit2"';
492
-        $label3   = __( 'Help text', 'invoicing' );
493
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
492
+        $label3   = __('Help text', 'invoicing');
493
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
494 494
         $id3      = $field . '.id + "_edit3"';
495
-        $label5   = __( 'Is this field required?', 'invoicing' );
495
+        $label5   = __('Is this field required?', 'invoicing');
496 496
         $id4      = $field . '.id + "_edit4"';
497 497
         echo "
498 498
             <div $restrict>
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
     /**
521 521
      * Renders the textarea element template.
522 522
      */
523
-    public function render_textarea_template( $field ) {
524
-        $restrict = $this->get_restrict_markup( $field, 'textarea' );
523
+    public function render_textarea_template($field) {
524
+        $restrict = $this->get_restrict_markup($field, 'textarea');
525 525
         $label    = "$field.label";
526 526
         echo "
527 527
             <div $restrict>
@@ -535,24 +535,24 @@  discard block
 block discarded – undo
535 535
     /**
536 536
      * Renders the textarea element on the frontend.
537 537
      */
538
-    public function frontend_render_textarea_template( $field ) {
538
+    public function frontend_render_textarea_template($field) {
539 539
         
540 540
         echo "<div class='form-group'>";
541 541
 
542 542
         echo aui()->textarea(
543 543
             array(
544
-                'name'       => esc_attr( $field['id'] ),
545
-                'id'         => esc_attr( $field['id'] ),
546
-                'placeholder'=> esc_attr( $field['placeholder'] ),
544
+                'name'       => esc_attr($field['id']),
545
+                'id'         => esc_attr($field['id']),
546
+                'placeholder'=> esc_attr($field['placeholder']),
547 547
                 'required'   => (bool) $field['required'],
548
-                'label'      => wp_kses_post( $field['label'] ),
548
+                'label'      => wp_kses_post($field['label']),
549 549
                 'no_wrap'    => true,
550 550
                 'rows'       => 3,
551 551
             )
552 552
         );
553 553
 
554
-        if ( ! empty( $field['description'] ) ) {
555
-            $description = wp_kses_post( $field['description'] );
554
+        if (!empty($field['description'])) {
555
+            $description = wp_kses_post($field['description']);
556 556
             echo "<small class='form-text text-muted'>$description</small>";
557 557
         }
558 558
 
@@ -563,16 +563,16 @@  discard block
 block discarded – undo
563 563
     /**
564 564
      * Renders the edit textarea element template.
565 565
      */
566
-    public function edit_textarea_template( $field ) {
567
-        $restrict = $this->get_restrict_markup( $field, 'textarea' );
568
-        $label    = __( 'Field Label', 'invoicing' );
566
+    public function edit_textarea_template($field) {
567
+        $restrict = $this->get_restrict_markup($field, 'textarea');
568
+        $label    = __('Field Label', 'invoicing');
569 569
         $id       = $field . '.id + "_edit"';
570
-        $label2   = __( 'Placeholder text', 'invoicing' );
570
+        $label2   = __('Placeholder text', 'invoicing');
571 571
         $id2      = $field . '.id + "_edit2"';
572
-        $label3   = __( 'Help text', 'invoicing' );
573
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
572
+        $label3   = __('Help text', 'invoicing');
573
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
574 574
         $id3      = $field . '.id + "_edit3"';
575
-        $label5   = __( 'Is this field required?', 'invoicing' );
575
+        $label5   = __('Is this field required?', 'invoicing');
576 576
         $id4      = $field . '.id + "_edit4"';
577 577
         echo "
578 578
             <div $restrict>
@@ -600,8 +600,8 @@  discard block
 block discarded – undo
600 600
     /**
601 601
      * Renders the select element template.
602 602
      */
603
-    public function render_select_template( $field ) {
604
-        $restrict    = $this->get_restrict_markup( $field, 'select' );
603
+    public function render_select_template($field) {
604
+        $restrict    = $this->get_restrict_markup($field, 'select');
605 605
         $label       = "$field.label";
606 606
         $placeholder = "$field.placeholder";
607 607
         $id          = $field . '.id';
@@ -620,24 +620,24 @@  discard block
 block discarded – undo
620 620
     /**
621 621
      * Renders the select element on the frontend.
622 622
      */
623
-    public function frontend_render_select_template( $field ) {
623
+    public function frontend_render_select_template($field) {
624 624
         
625 625
         echo "<div class='form-group'>";
626 626
 
627 627
         echo aui()->select(
628 628
             array(
629
-                'name'       => esc_attr( $field['id'] ),
630
-                'id'         => esc_attr( $field['id'] ),
631
-                'placeholder'=> esc_attr( $field['placeholder'] ),
629
+                'name'       => esc_attr($field['id']),
630
+                'id'         => esc_attr($field['id']),
631
+                'placeholder'=> esc_attr($field['placeholder']),
632 632
                 'required'   => (bool) $field['required'],
633
-                'label'      => wp_kses_post( $field['label'] ),
633
+                'label'      => wp_kses_post($field['label']),
634 634
                 'no_wrap'    => true,
635
-                'options'    => array_combine( $field['options'], $field['options'] ),
635
+                'options'    => array_combine($field['options'], $field['options']),
636 636
             )
637 637
         );
638 638
 
639
-        if ( ! empty( $field['description'] ) ) {
640
-            $description = wp_kses_post( $field['description'] );
639
+        if (!empty($field['description'])) {
640
+            $description = wp_kses_post($field['description']);
641 641
             echo "<small class='form-text text-muted'>$description</small>";
642 642
         }
643 643
 
@@ -648,18 +648,18 @@  discard block
 block discarded – undo
648 648
     /**
649 649
      * Renders the edit select element template.
650 650
      */
651
-    public function edit_select_template( $field ) {
652
-        $restrict = $this->get_restrict_markup( $field, 'select' );
653
-        $label    = __( 'Field Label', 'invoicing' );
651
+    public function edit_select_template($field) {
652
+        $restrict = $this->get_restrict_markup($field, 'select');
653
+        $label    = __('Field Label', 'invoicing');
654 654
         $id       = $field . '.id + "_edit"';
655
-        $label2   = __( 'Placeholder text', 'invoicing' );
655
+        $label2   = __('Placeholder text', 'invoicing');
656 656
         $id2      = $field . '.id + "_edit2"';
657
-        $label3   = __( 'Help text', 'invoicing' );
658
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
657
+        $label3   = __('Help text', 'invoicing');
658
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
659 659
         $id3      = $field . '.id + "_edit3"';
660
-        $label5   = __( 'Is this field required?', 'invoicing' );
660
+        $label5   = __('Is this field required?', 'invoicing');
661 661
         $id4      = $field . '.id + "_edit4"';
662
-        $label6   = __( 'Available Options', 'invoicing' );
662
+        $label6   = __('Available Options', 'invoicing');
663 663
         echo "
664 664
             <div $restrict>
665 665
                 <div class='form-group'>
@@ -697,8 +697,8 @@  discard block
 block discarded – undo
697 697
     /**
698 698
      * Renders the checkbox element template.
699 699
      */
700
-    public function render_checkbox_template( $field ) {
701
-        $restrict = $this->get_restrict_markup( $field, 'checkbox' );
700
+    public function render_checkbox_template($field) {
701
+        $restrict = $this->get_restrict_markup($field, 'checkbox');
702 702
         $label    = "$field.label";
703 703
         echo "
704 704
             <div class='form-check' $restrict>
@@ -712,24 +712,24 @@  discard block
 block discarded – undo
712 712
     /**
713 713
      * Renders the checkbox element on the frontend.
714 714
      */
715
-    public function frontend_render_checkbox_template( $field ) {
715
+    public function frontend_render_checkbox_template($field) {
716 716
         
717 717
         echo "<div class='form-group'>";
718 718
 
719 719
         echo aui()->input(
720 720
             array(
721
-                'name'       => esc_attr( $field['id'] ),
722
-                'id'         => esc_attr( $field['id'] ),
721
+                'name'       => esc_attr($field['id']),
722
+                'id'         => esc_attr($field['id']),
723 723
                 'required'   => (bool) $field['required'],
724
-                'label'      => wp_kses_post( $field['label'] ),
724
+                'label'      => wp_kses_post($field['label']),
725 725
                 'no_wrap'    => true,
726
-                'value'      => esc_attr__( 'Yes', 'invoicing' ),
726
+                'value'      => esc_attr__('Yes', 'invoicing'),
727 727
                 'type'       => 'checkbox',
728 728
             )
729 729
         );
730 730
 
731
-        if ( ! empty( $field['description'] ) ) {
732
-            $description = wp_kses_post( $field['description'] );
731
+        if (!empty($field['description'])) {
732
+            $description = wp_kses_post($field['description']);
733 733
             echo "<small class='form-text text-muted'>$description</small>";
734 734
         }
735 735
 
@@ -740,14 +740,14 @@  discard block
 block discarded – undo
740 740
     /**
741 741
      * Renders the edit checkbox element template.
742 742
      */
743
-    public function edit_checkbox_template( $field ) {
744
-        $restrict = $this->get_restrict_markup( $field, 'checkbox' );
745
-        $label    = __( 'Field Label', 'invoicing' );
743
+    public function edit_checkbox_template($field) {
744
+        $restrict = $this->get_restrict_markup($field, 'checkbox');
745
+        $label    = __('Field Label', 'invoicing');
746 746
         $id       = $field . '.id + "_edit"';
747
-        $label2   = __( 'Help text', 'invoicing' );
748
-        $label3   = esc_attr__( 'Add some help text for this field', 'invoicing' );
747
+        $label2   = __('Help text', 'invoicing');
748
+        $label3   = esc_attr__('Add some help text for this field', 'invoicing');
749 749
         $id2      = $field . '.id + "_edit2"';
750
-        $label4   = __( 'Is this field required?', 'invoicing' );
750
+        $label4   = __('Is this field required?', 'invoicing');
751 751
         $id3      = $field . '.id + "_edit3"';
752 752
         echo "
753 753
             <div $restrict>
@@ -771,8 +771,8 @@  discard block
 block discarded – undo
771 771
     /**
772 772
      * Renders the radio element template.
773 773
      */
774
-    public function render_radio_template( $field ) {
775
-        $restrict    = $this->get_restrict_markup( $field, 'radio' );
774
+    public function render_radio_template($field) {
775
+        $restrict    = $this->get_restrict_markup($field, 'radio');
776 776
         $label       = "$field.label";
777 777
         $id          = $field . '.id';
778 778
         echo "
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
     /**
791 791
      * Renders the radio element on the frontend.
792 792
      */
793
-    public function frontend_render_radio_template( $field ) {
793
+    public function frontend_render_radio_template($field) {
794 794
         
795 795
         echo "<div class='form-group'>";
796 796
 
797
-        if ( ! empty( $field['label'] ) ) {
798
-            $label = wp_kses_post( $field['label'] );
797
+        if (!empty($field['label'])) {
798
+            $label = wp_kses_post($field['label']);
799 799
             echo "<legend class='col-form-label'>$label</legend>";
800 800
         }
801 801
 
802
-        foreach( $field['options'] as $index => $option ) {
802
+        foreach ($field['options'] as $index => $option) {
803 803
             $id    = $field['id'] . $index;
804 804
             $name  = $field['id'];
805
-            $value = esc_attr( $option );
806
-            $label = wp_kses_post( $option );
805
+            $value = esc_attr($option);
806
+            $label = wp_kses_post($option);
807 807
 
808 808
             echo "
809 809
                 <div class='form-check'>
@@ -813,8 +813,8 @@  discard block
 block discarded – undo
813 813
             ";
814 814
         }
815 815
 
816
-        if ( ! empty( $field['description'] ) ) {
817
-            $description = wp_kses_post( $field['description'] );
816
+        if (!empty($field['description'])) {
817
+            $description = wp_kses_post($field['description']);
818 818
             echo "<small class='form-text text-muted'>$description</small>";
819 819
         }
820 820
 
@@ -825,16 +825,16 @@  discard block
 block discarded – undo
825 825
     /**
826 826
      * Renders the edit radio element template.
827 827
      */
828
-    public function edit_radio_template( $field ) {
829
-        $restrict = $this->get_restrict_markup( $field, 'radio' );
830
-        $label    = __( 'Field Label', 'invoicing' );
828
+    public function edit_radio_template($field) {
829
+        $restrict = $this->get_restrict_markup($field, 'radio');
830
+        $label    = __('Field Label', 'invoicing');
831 831
         $id       = $field . '.id + "_edit"';
832
-        $label2   = __( 'Help text', 'invoicing' );
833
-        $label3   = esc_attr__( 'Add some help text for this field', 'invoicing' );
832
+        $label2   = __('Help text', 'invoicing');
833
+        $label3   = esc_attr__('Add some help text for this field', 'invoicing');
834 834
         $id2      = $field . '.id + "_edit3"';
835
-        $label4   = __( 'Is this field required?', 'invoicing' );
835
+        $label4   = __('Is this field required?', 'invoicing');
836 836
         $id3      = $field . '.id + "_edit4"';
837
-        $label5   = __( 'Available Options', 'invoicing' );
837
+        $label5   = __('Available Options', 'invoicing');
838 838
         echo "
839 839
             <div $restrict>
840 840
                 <div class='form-group'>
@@ -868,8 +868,8 @@  discard block
 block discarded – undo
868 868
     /**
869 869
      * Renders the address element template.
870 870
      */
871
-    public function render_address_template( $field ) {
872
-        $restrict    = $this->get_restrict_markup( $field, 'address' );
871
+    public function render_address_template($field) {
872
+        $restrict = $this->get_restrict_markup($field, 'address');
873 873
 
874 874
         echo "
875 875
             <div class='wpinv-address-wrapper' $restrict>
@@ -887,38 +887,38 @@  discard block
 block discarded – undo
887 887
     /**
888 888
      * Renders the address element on the frontend.
889 889
      */
890
-    public function frontend_render_address_template( $field ) {
890
+    public function frontend_render_address_template($field) {
891 891
         
892 892
         echo "<div class='wpinv-address-fields'>";
893 893
 
894
-        foreach( $field['fields'] as $address_field ) {
894
+        foreach ($field['fields'] as $address_field) {
895 895
 
896
-            if ( empty( $address_field['visible'] ) ) {
896
+            if (empty($address_field['visible'])) {
897 897
                 continue;
898 898
             }
899 899
 
900
-            $class = esc_attr( $address_field['name'] );
900
+            $class = esc_attr($address_field['name']);
901 901
             echo "<div class='form-group $class'>";
902 902
 
903 903
             $label = $address_field['label'];
904 904
 
905
-            if ( ! empty( $address_field['required'] ) ) {
905
+            if (!empty($address_field['required'])) {
906 906
                 $label .= "<span class='text-danger'> *</span>";
907 907
             }
908 908
             echo aui()->input(
909 909
                 array(
910
-                    'name'       => esc_attr( $address_field['name'] ),
911
-                    'id'         => esc_attr( $address_field['name'] ),
910
+                    'name'       => esc_attr($address_field['name']),
911
+                    'id'         => esc_attr($address_field['name']),
912 912
                     'required'   => (bool) $address_field['required'],
913
-                    'label'      => wp_kses_post( $label ),
913
+                    'label'      => wp_kses_post($label),
914 914
                     'no_wrap'    => true,
915
-                    'placeholder' => esc_attr( $address_field['placeholder'] ),
915
+                    'placeholder' => esc_attr($address_field['placeholder']),
916 916
                     'type'       => 'text',
917 917
                 )
918 918
             );
919 919
 
920
-            if ( ! empty( $address_field['description'] ) ) {
921
-                $description = wp_kses_post( $address_field['description'] );
920
+            if (!empty($address_field['description'])) {
921
+                $description = wp_kses_post($address_field['description']);
922 922
                 echo "<small class='form-text text-muted'>$description</small>";
923 923
             }
924 924
     
@@ -933,13 +933,13 @@  discard block
 block discarded – undo
933 933
     /**
934 934
      * Renders the edit address element template.
935 935
      */
936
-    public function edit_address_template( $field ) {
937
-        $restrict  = $this->get_restrict_markup( $field, 'address' );
938
-        $label     = __( 'Field Label', 'invoicing' );
939
-        $label2    = __( 'Placeholder', 'invoicing' );
940
-        $label3    = __( 'Description', 'invoicing' );
941
-        $label4    = __( 'Is required', 'invoicing' );
942
-        $label5    = __( 'Is visible', 'invoicing' );
936
+    public function edit_address_template($field) {
937
+        $restrict  = $this->get_restrict_markup($field, 'address');
938
+        $label     = __('Field Label', 'invoicing');
939
+        $label2    = __('Placeholder', 'invoicing');
940
+        $label3    = __('Description', 'invoicing');
941
+        $label4    = __('Is required', 'invoicing');
942
+        $label5    = __('Is visible', 'invoicing');
943 943
         $id        = $field . '.id + "_edit_label"';
944 944
         $id2       = $field . '.id + "_edit_placeholder"';
945 945
         $id3       = $field . '.id + "_edit_description"';
@@ -1007,8 +1007,8 @@  discard block
 block discarded – undo
1007 1007
     /**
1008 1008
      * Renders the email element template.
1009 1009
      */
1010
-    public function render_email_template( $field ) {
1011
-        $restrict = $this->get_restrict_markup( $field, 'email' );
1010
+    public function render_email_template($field) {
1011
+        $restrict = $this->get_restrict_markup($field, 'email');
1012 1012
         $label    = "$field.label";
1013 1013
         echo "
1014 1014
             <div $restrict>
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
     /**
1023 1023
      * Renders the billing_email element template.
1024 1024
      */
1025
-    public function render_billing_email_template( $field ) {
1026
-        $restrict = $this->get_restrict_markup( $field, 'billing_email' );
1025
+    public function render_billing_email_template($field) {
1026
+        $restrict = $this->get_restrict_markup($field, 'billing_email');
1027 1027
         $label    = "$field.label";
1028 1028
         echo "
1029 1029
             <div $restrict>
@@ -1037,24 +1037,24 @@  discard block
 block discarded – undo
1037 1037
     /**
1038 1038
      * Renders the email element on the frontend.
1039 1039
      */
1040
-    public function frontend_render_email_template( $field ) {
1040
+    public function frontend_render_email_template($field) {
1041 1041
         
1042 1042
         echo "<div class='form-group'>";
1043 1043
 
1044 1044
         echo aui()->input(
1045 1045
             array(
1046
-                'name'       => esc_attr( $field['id'] ),
1047
-                'id'         => esc_attr( $field['id'] ),
1046
+                'name'       => esc_attr($field['id']),
1047
+                'id'         => esc_attr($field['id']),
1048 1048
                 'required'   => (bool) $field['required'],
1049
-                'label'      => wp_kses_post( $field['label'] ),
1049
+                'label'      => wp_kses_post($field['label']),
1050 1050
                 'no_wrap'    => true,
1051
-                'placeholder' => esc_attr( $field['placeholder'] ),
1051
+                'placeholder' => esc_attr($field['placeholder']),
1052 1052
                 'type'       => 'email',
1053 1053
             )
1054 1054
         );
1055 1055
 
1056
-        if ( ! empty( $field['description'] ) ) {
1057
-            $description = wp_kses_post( $field['description'] );
1056
+        if (!empty($field['description'])) {
1057
+            $description = wp_kses_post($field['description']);
1058 1058
             echo "<small class='form-text text-muted'>$description</small>";
1059 1059
         }
1060 1060
 
@@ -1065,30 +1065,30 @@  discard block
 block discarded – undo
1065 1065
     /**
1066 1066
      * Renders the billing email element on the frontend.
1067 1067
      */
1068
-    public function frontend_render_billing_email_template( $field ) {
1068
+    public function frontend_render_billing_email_template($field) {
1069 1069
         
1070 1070
         echo "<div class='form-group'>";
1071 1071
         $value = '';
1072 1072
 
1073
-        if ( is_user_logged_in() ) {
1073
+        if (is_user_logged_in()) {
1074 1074
             $user  = wp_get_current_user();
1075
-            $value = sanitize_email( $user->user_email );
1075
+            $value = sanitize_email($user->user_email);
1076 1076
         }
1077 1077
         echo aui()->input(
1078 1078
             array(
1079 1079
                 'name'       => 'billing_email',
1080 1080
                 'value'      => $value,
1081
-                'id'         => esc_attr( $field['id'] ),
1081
+                'id'         => esc_attr($field['id']),
1082 1082
                 'required'   => true,
1083
-                'label'      => wp_kses_post( $field['label'] ),
1083
+                'label'      => wp_kses_post($field['label']),
1084 1084
                 'no_wrap'    => true,
1085
-                'placeholder' => esc_attr( $field['placeholder'] ),
1085
+                'placeholder' => esc_attr($field['placeholder']),
1086 1086
                 'type'       => 'email',
1087 1087
             )
1088 1088
         );
1089 1089
 
1090
-        if ( ! empty( $field['description'] ) ) {
1091
-            $description = wp_kses_post( $field['description'] );
1090
+        if (!empty($field['description'])) {
1091
+            $description = wp_kses_post($field['description']);
1092 1092
             echo "<small class='form-text text-muted'>$description</small>";
1093 1093
         }
1094 1094
 
@@ -1099,16 +1099,16 @@  discard block
 block discarded – undo
1099 1099
     /**
1100 1100
      * Renders the edit email element template.
1101 1101
      */
1102
-    public function edit_email_template( $field ) {
1103
-        $restrict = $this->get_restrict_markup( $field, 'email' );
1104
-        $label    = __( 'Field Label', 'invoicing' );
1102
+    public function edit_email_template($field) {
1103
+        $restrict = $this->get_restrict_markup($field, 'email');
1104
+        $label    = __('Field Label', 'invoicing');
1105 1105
         $id       = $field . '.id + "_edit"';
1106
-        $label2   = __( 'Placeholder text', 'invoicing' );
1106
+        $label2   = __('Placeholder text', 'invoicing');
1107 1107
         $id2      = $field . '.id + "_edit2"';
1108
-        $label3   = __( 'Help text', 'invoicing' );
1109
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1108
+        $label3   = __('Help text', 'invoicing');
1109
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
1110 1110
         $id3      = $field . '.id + "_edit3"';
1111
-        $label5   = __( 'Is this field required?', 'invoicing' );
1111
+        $label5   = __('Is this field required?', 'invoicing');
1112 1112
         $id4      = $field . '.id + "_edit4"';
1113 1113
         echo "
1114 1114
             <div $restrict>
@@ -1136,16 +1136,16 @@  discard block
 block discarded – undo
1136 1136
     /**
1137 1137
      * Renders the edit billing_email element template.
1138 1138
      */
1139
-    public function edit_billing_email_template( $field ) {
1140
-        $restrict = $this->get_restrict_markup( $field, 'billing_email' );
1141
-        $label    = __( 'Field Label', 'invoicing' );
1139
+    public function edit_billing_email_template($field) {
1140
+        $restrict = $this->get_restrict_markup($field, 'billing_email');
1141
+        $label    = __('Field Label', 'invoicing');
1142 1142
         $id       = $field . '.id + "_edit"';
1143
-        $label2   = __( 'Placeholder text', 'invoicing' );
1143
+        $label2   = __('Placeholder text', 'invoicing');
1144 1144
         $id2      = $field . '.id + "_edit2"';
1145
-        $label3   = __( 'Help text', 'invoicing' );
1146
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1145
+        $label3   = __('Help text', 'invoicing');
1146
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
1147 1147
         $id3      = $field . '.id + "_edit3"';
1148
-        $label5   = __( 'Is this field required?', 'invoicing' );
1148
+        $label5   = __('Is this field required?', 'invoicing');
1149 1149
         $id4      = $field . '.id + "_edit4"';
1150 1150
         echo "
1151 1151
             <div $restrict>
@@ -1169,8 +1169,8 @@  discard block
 block discarded – undo
1169 1169
     /**
1170 1170
      * Renders the website element template.
1171 1171
      */
1172
-    public function render_website_template( $field ) {
1173
-        $restrict = $this->get_restrict_markup( $field, 'website' );
1172
+    public function render_website_template($field) {
1173
+        $restrict = $this->get_restrict_markup($field, 'website');
1174 1174
         $label    = "$field.label";
1175 1175
         echo "
1176 1176
             <div $restrict>
@@ -1184,24 +1184,24 @@  discard block
 block discarded – undo
1184 1184
     /**
1185 1185
      * Renders the website element on the frontend.
1186 1186
      */
1187
-    public function frontend_render_website_template( $field ) {
1187
+    public function frontend_render_website_template($field) {
1188 1188
         
1189 1189
         echo "<div class='form-group'>";
1190 1190
 
1191 1191
         echo aui()->input(
1192 1192
             array(
1193
-                'name'       => esc_attr( $field['id'] ),
1194
-                'id'         => esc_attr( $field['id'] ),
1193
+                'name'       => esc_attr($field['id']),
1194
+                'id'         => esc_attr($field['id']),
1195 1195
                 'required'   => (bool) $field['required'],
1196
-                'label'      => wp_kses_post( $field['label'] ),
1196
+                'label'      => wp_kses_post($field['label']),
1197 1197
                 'no_wrap'    => true,
1198
-                'placeholder' => esc_attr( $field['placeholder'] ),
1198
+                'placeholder' => esc_attr($field['placeholder']),
1199 1199
                 'type'       => 'url',
1200 1200
             )
1201 1201
         );
1202 1202
 
1203
-        if ( ! empty( $field['description'] ) ) {
1204
-            $description = wp_kses_post( $field['description'] );
1203
+        if (!empty($field['description'])) {
1204
+            $description = wp_kses_post($field['description']);
1205 1205
             echo "<small class='form-text text-muted'>$description</small>";
1206 1206
         }
1207 1207
 
@@ -1212,16 +1212,16 @@  discard block
 block discarded – undo
1212 1212
     /**
1213 1213
      * Renders the edit website element template.
1214 1214
      */
1215
-    public function edit_website_template( $field ) {
1216
-        $restrict = $this->get_restrict_markup( $field, 'website' );
1217
-        $label    = __( 'Field Label', 'invoicing' );
1215
+    public function edit_website_template($field) {
1216
+        $restrict = $this->get_restrict_markup($field, 'website');
1217
+        $label    = __('Field Label', 'invoicing');
1218 1218
         $id       = $field . '.id + "_edit"';
1219
-        $label2   = __( 'Placeholder text', 'invoicing' );
1219
+        $label2   = __('Placeholder text', 'invoicing');
1220 1220
         $id2      = $field . '.id + "_edit2"';
1221
-        $label3   = __( 'Help text', 'invoicing' );
1222
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1221
+        $label3   = __('Help text', 'invoicing');
1222
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
1223 1223
         $id3      = $field . '.id + "_edit3"';
1224
-        $label5   = __( 'Is this field required?', 'invoicing' );
1224
+        $label5   = __('Is this field required?', 'invoicing');
1225 1225
         $id4      = $field . '.id + "_edit4"';
1226 1226
         echo "
1227 1227
             <div $restrict>
@@ -1249,8 +1249,8 @@  discard block
 block discarded – undo
1249 1249
     /**
1250 1250
      * Renders the date element template.
1251 1251
      */
1252
-    public function render_date_template( $field ) {
1253
-        $restrict = $this->get_restrict_markup( $field, 'date' );
1252
+    public function render_date_template($field) {
1253
+        $restrict = $this->get_restrict_markup($field, 'date');
1254 1254
         $label    = "$field.label";
1255 1255
         echo "
1256 1256
             <div $restrict>
@@ -1264,24 +1264,24 @@  discard block
 block discarded – undo
1264 1264
     /**
1265 1265
      * Renders the date element on the frontend.
1266 1266
      */
1267
-    public function frontend_render_date_template( $field ) {
1267
+    public function frontend_render_date_template($field) {
1268 1268
         
1269 1269
         echo "<div class='form-group'>";
1270 1270
 
1271 1271
         echo aui()->input(
1272 1272
             array(
1273
-                'name'       => esc_attr( $field['id'] ),
1274
-                'id'         => esc_attr( $field['id'] ),
1273
+                'name'       => esc_attr($field['id']),
1274
+                'id'         => esc_attr($field['id']),
1275 1275
                 'required'   => (bool) $field['required'],
1276
-                'label'      => wp_kses_post( $field['label'] ),
1277
-                'placeholder' => esc_attr( $field['placeholder'] ),
1276
+                'label'      => wp_kses_post($field['label']),
1277
+                'placeholder' => esc_attr($field['placeholder']),
1278 1278
                 'no_wrap'    => true,
1279 1279
                 'type'       => 'date',
1280 1280
             )
1281 1281
         );
1282 1282
 
1283
-        if ( ! empty( $field['description'] ) ) {
1284
-            $description = wp_kses_post( $field['description'] );
1283
+        if (!empty($field['description'])) {
1284
+            $description = wp_kses_post($field['description']);
1285 1285
             echo "<small class='form-text text-muted'>$description</small>";
1286 1286
         }
1287 1287
 
@@ -1292,16 +1292,16 @@  discard block
 block discarded – undo
1292 1292
     /**
1293 1293
      * Renders the edit date element template.
1294 1294
      */
1295
-    public function edit_date_template( $field ) {
1296
-        $restrict = $this->get_restrict_markup( $field, 'date' );
1297
-        $label    = __( 'Field Label', 'invoicing' );
1295
+    public function edit_date_template($field) {
1296
+        $restrict = $this->get_restrict_markup($field, 'date');
1297
+        $label    = __('Field Label', 'invoicing');
1298 1298
         $id       = $field . '.id + "_edit"';
1299
-        $label2   = __( 'Placeholder text', 'invoicing' );
1299
+        $label2   = __('Placeholder text', 'invoicing');
1300 1300
         $id2      = $field . '.id + "_edit2"';
1301
-        $label3   = __( 'Help text', 'invoicing' );
1302
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1301
+        $label3   = __('Help text', 'invoicing');
1302
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
1303 1303
         $id3      = $field . '.id + "_edit3"';
1304
-        $label5   = __( 'Is this field required?', 'invoicing' );
1304
+        $label5   = __('Is this field required?', 'invoicing');
1305 1305
         $id4      = $field . '.id + "_edit4"';
1306 1306
         echo "
1307 1307
             <div $restrict>
@@ -1329,8 +1329,8 @@  discard block
 block discarded – undo
1329 1329
     /**
1330 1330
      * Renders the time element template.
1331 1331
      */
1332
-    public function render_time_template( $field ) {
1333
-        $restrict = $this->get_restrict_markup( $field, 'time' );
1332
+    public function render_time_template($field) {
1333
+        $restrict = $this->get_restrict_markup($field, 'time');
1334 1334
         $label    = "$field.label";
1335 1335
         echo "
1336 1336
             <div $restrict>
@@ -1344,24 +1344,24 @@  discard block
 block discarded – undo
1344 1344
     /**
1345 1345
      * Renders the time element on the frontend.
1346 1346
      */
1347
-    public function frontend_render_time_template( $field ) {
1347
+    public function frontend_render_time_template($field) {
1348 1348
         
1349 1349
         echo "<div class='form-group'>";
1350 1350
 
1351 1351
         echo aui()->input(
1352 1352
             array(
1353
-                'name'       => esc_attr( $field['id'] ),
1354
-                'id'         => esc_attr( $field['id'] ),
1353
+                'name'       => esc_attr($field['id']),
1354
+                'id'         => esc_attr($field['id']),
1355 1355
                 'required'   => (bool) $field['required'],
1356
-                'label'      => wp_kses_post( $field['label'] ),
1356
+                'label'      => wp_kses_post($field['label']),
1357 1357
                 'no_wrap'    => true,
1358
-                'placeholder' => esc_attr( $field['placeholder'] ),
1358
+                'placeholder' => esc_attr($field['placeholder']),
1359 1359
                 'type'       => 'time',
1360 1360
             )
1361 1361
         );
1362 1362
 
1363
-        if ( ! empty( $field['description'] ) ) {
1364
-            $description = wp_kses_post( $field['description'] );
1363
+        if (!empty($field['description'])) {
1364
+            $description = wp_kses_post($field['description']);
1365 1365
             echo "<small class='form-text text-muted'>$description</small>";
1366 1366
         }
1367 1367
 
@@ -1372,16 +1372,16 @@  discard block
 block discarded – undo
1372 1372
     /**
1373 1373
      * Renders the edit time element template.
1374 1374
      */
1375
-    public function edit_time_template( $field ) {
1376
-        $restrict = $this->get_restrict_markup( $field, 'time' );
1377
-        $label    = __( 'Field Label', 'invoicing' );
1375
+    public function edit_time_template($field) {
1376
+        $restrict = $this->get_restrict_markup($field, 'time');
1377
+        $label    = __('Field Label', 'invoicing');
1378 1378
         $id       = $field . '.id + "_edit"';
1379
-        $label2   = __( 'Placeholder text', 'invoicing' );
1379
+        $label2   = __('Placeholder text', 'invoicing');
1380 1380
         $id2      = $field . '.id + "_edit2"';
1381
-        $label3   = __( 'Help text', 'invoicing' );
1382
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1381
+        $label3   = __('Help text', 'invoicing');
1382
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
1383 1383
         $id3      = $field . '.id + "_edit3"';
1384
-        $label5   = __( 'Is this field required?', 'invoicing' );
1384
+        $label5   = __('Is this field required?', 'invoicing');
1385 1385
         $id4      = $field . '.id + "_edit4"';
1386 1386
         echo "
1387 1387
             <div $restrict>
@@ -1409,8 +1409,8 @@  discard block
 block discarded – undo
1409 1409
     /**
1410 1410
      * Renders the number element template.
1411 1411
      */
1412
-    public function render_number_template( $field ) {
1413
-        $restrict = $this->get_restrict_markup( $field, 'number' );
1412
+    public function render_number_template($field) {
1413
+        $restrict = $this->get_restrict_markup($field, 'number');
1414 1414
         $label    = "$field.label";
1415 1415
         echo "
1416 1416
             <div $restrict>
@@ -1424,24 +1424,24 @@  discard block
 block discarded – undo
1424 1424
     /**
1425 1425
      * Renders the number element on the frontend.
1426 1426
      */
1427
-    public function frontend_render_number_template( $field ) {
1427
+    public function frontend_render_number_template($field) {
1428 1428
         
1429 1429
         echo "<div class='form-group'>";
1430 1430
 
1431 1431
         echo aui()->input(
1432 1432
             array(
1433
-                'name'       => esc_attr( $field['id'] ),
1434
-                'id'         => esc_attr( $field['id'] ),
1433
+                'name'       => esc_attr($field['id']),
1434
+                'id'         => esc_attr($field['id']),
1435 1435
                 'required'   => (bool) $field['required'],
1436
-                'label'      => wp_kses_post( $field['label'] ),
1437
-                'placeholder' => esc_attr( $field['placeholder'] ),
1436
+                'label'      => wp_kses_post($field['label']),
1437
+                'placeholder' => esc_attr($field['placeholder']),
1438 1438
                 'no_wrap'    => true,
1439 1439
                 'type'       => 'number',
1440 1440
             )
1441 1441
         );
1442 1442
 
1443
-        if ( ! empty( $field['description'] ) ) {
1444
-            $description = wp_kses_post( $field['description'] );
1443
+        if (!empty($field['description'])) {
1444
+            $description = wp_kses_post($field['description']);
1445 1445
             echo "<small class='form-text text-muted'>$description</small>";
1446 1446
         }
1447 1447
 
@@ -1452,16 +1452,16 @@  discard block
 block discarded – undo
1452 1452
     /**
1453 1453
      * Renders the edit number element template.
1454 1454
      */
1455
-    public function edit_number_template( $field ) {
1456
-        $restrict = $this->get_restrict_markup( $field, 'number' );
1457
-        $label    = __( 'Field Label', 'invoicing' );
1455
+    public function edit_number_template($field) {
1456
+        $restrict = $this->get_restrict_markup($field, 'number');
1457
+        $label    = __('Field Label', 'invoicing');
1458 1458
         $id       = $field . '.id + "_edit"';
1459
-        $label2   = __( 'Placeholder text', 'invoicing' );
1459
+        $label2   = __('Placeholder text', 'invoicing');
1460 1460
         $id2      = $field . '.id + "_edit2"';
1461
-        $label3   = __( 'Help text', 'invoicing' );
1462
-        $label4   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1461
+        $label3   = __('Help text', 'invoicing');
1462
+        $label4   = esc_attr__('Add some help text for this field', 'invoicing');
1463 1463
         $id3      = $field . '.id + "_edit3"';
1464
-        $label5   = __( 'Is this field required?', 'invoicing' );
1464
+        $label5   = __('Is this field required?', 'invoicing');
1465 1465
         $id4      = $field . '.id + "_edit4"';
1466 1466
         echo "
1467 1467
             <div $restrict>
@@ -1489,23 +1489,23 @@  discard block
 block discarded – undo
1489 1489
     /**
1490 1490
      * Renders the separator element template.
1491 1491
      */
1492
-    public function render_separator_template( $field ) {
1493
-        $restrict = $this->get_restrict_markup( $field, 'separator' );
1492
+    public function render_separator_template($field) {
1493
+        $restrict = $this->get_restrict_markup($field, 'separator');
1494 1494
         echo "<hr class='featurette-divider mt-0 mb-2' $restrict>";
1495 1495
     }
1496 1496
 
1497 1497
     /**
1498 1498
      * Renders the separator element on the frontend.
1499 1499
      */
1500
-    public function frontend_render_separator_template( $field ) {
1500
+    public function frontend_render_separator_template($field) {
1501 1501
         echo '<hr class="featurette-divider mt-0 mb-2" />';
1502 1502
     }
1503 1503
 
1504 1504
     /**
1505 1505
      * Renders the pay button element template.
1506 1506
      */
1507
-    public function render_pay_button_template( $field ) {
1508
-        $restrict = $this->get_restrict_markup( $field, 'pay_button' );
1507
+    public function render_pay_button_template($field) {
1508
+        $restrict = $this->get_restrict_markup($field, 'pay_button');
1509 1509
         $label    = "$field.label";
1510 1510
         echo "
1511 1511
             <div $restrict>
@@ -1518,24 +1518,24 @@  discard block
 block discarded – undo
1518 1518
     /**
1519 1519
      * Renders the pay_button element on the frontend.
1520 1520
      */
1521
-    public function frontend_render_pay_button_template( $field ) {
1521
+    public function frontend_render_pay_button_template($field) {
1522 1522
         
1523 1523
         echo "<div class='form-group'>";
1524 1524
 
1525
-        $class = 'btn btn-block submit-button ' . sanitize_html_class( $field['class'] );
1525
+        $class = 'btn btn-block submit-button ' . sanitize_html_class($field['class']);
1526 1526
         echo aui()->input(
1527 1527
             array(
1528
-                'name'       => esc_attr( $field['id'] ),
1529
-                'id'         => esc_attr( $field['id'] ),
1530
-                'value'      => esc_attr( $field['label'] ),
1528
+                'name'       => esc_attr($field['id']),
1529
+                'id'         => esc_attr($field['id']),
1530
+                'value'      => esc_attr($field['label']),
1531 1531
                 'no_wrap'    => true,
1532 1532
                 'type'       => 'submit',
1533 1533
                 'class'      => $class,
1534 1534
             )
1535 1535
         );
1536 1536
 
1537
-        if ( ! empty( $field['description'] ) ) {
1538
-            $description = wp_kses_post( $field['description'] );
1537
+        if (!empty($field['description'])) {
1538
+            $description = wp_kses_post($field['description']);
1539 1539
             echo "<small class='form-text text-muted'>$description</small>";
1540 1540
         }
1541 1541
 
@@ -1546,14 +1546,14 @@  discard block
 block discarded – undo
1546 1546
     /**
1547 1547
      * Renders the pay button element template.
1548 1548
      */
1549
-    public function edit_pay_button_template( $field ) {
1550
-        $restrict = $this->get_restrict_markup( $field, 'pay_button' );
1551
-        $label    = __( 'Button Text', 'invoicing' );
1549
+    public function edit_pay_button_template($field) {
1550
+        $restrict = $this->get_restrict_markup($field, 'pay_button');
1551
+        $label    = __('Button Text', 'invoicing');
1552 1552
         $id       = $field . '.id + "_edit"';
1553
-        $label2   = __( 'Help text', 'invoicing' );
1554
-        $label3   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1553
+        $label2   = __('Help text', 'invoicing');
1554
+        $label3   = esc_attr__('Add some help text for this field', 'invoicing');
1555 1555
         $id2      = $field . '.id + "_edit2"';
1556
-        $label4   = esc_attr__( 'Button Type', 'invoicing' );
1556
+        $label4   = esc_attr__('Button Type', 'invoicing');
1557 1557
         $id3      = $field . '.id + "_edit3"';
1558 1558
         echo "
1559 1559
             <div $restrict>
@@ -1569,15 +1569,15 @@  discard block
 block discarded – undo
1569 1569
                     <label :for='$id3'>$label4</label>
1570 1570
 
1571 1571
                     <select class='form-control custom-select' :id='$id3' v-model='$field.class'>
1572
-                        <option value='btn-primary'>"   . __( 'Primary', 'invoicing' ) ."</option>
1573
-                        <option value='btn-secondary'>" . __( 'Secondary', 'invoicing' ) ."</option>
1574
-                        <option value='btn-success'>"   . __( 'Success', 'invoicing' ) ."</option>
1575
-                        <option value='btn-danger'>"    . __( 'Danger', 'invoicing' ) ."</option>
1576
-                        <option value='btn-warning'>"   . __( 'Warning', 'invoicing' ) ."</option>
1577
-                        <option value='btn-info'>"      . __( 'Info', 'invoicing' ) ."</option>
1578
-                        <option value='btn-light'>"     . __( 'Light', 'invoicing' ) ."</option>
1579
-                        <option value='btn-dark'>"      . __( 'Dark', 'invoicing' ) ."</option>
1580
-                        <option value='btn-link'>"      . __( 'Link', 'invoicing' ) ."</option>
1572
+                        <option value='btn-primary'>" . __('Primary', 'invoicing') . "</option>
1573
+                        <option value='btn-secondary'>" . __('Secondary', 'invoicing') . "</option>
1574
+                        <option value='btn-success'>"   . __('Success', 'invoicing') . "</option>
1575
+                        <option value='btn-danger'>"    . __('Danger', 'invoicing') . "</option>
1576
+                        <option value='btn-warning'>"   . __('Warning', 'invoicing') . "</option>
1577
+                        <option value='btn-info'>"      . __('Info', 'invoicing') . "</option>
1578
+                        <option value='btn-light'>"     . __('Light', 'invoicing') . "</option>
1579
+                        <option value='btn-dark'>"      . __('Dark', 'invoicing') . "</option>
1580
+                        <option value='btn-link'>"      . __('Link', 'invoicing') . "</option>
1581 1581
                     </select>
1582 1582
                 </div>
1583 1583
             </div>
@@ -1588,8 +1588,8 @@  discard block
 block discarded – undo
1588 1588
     /**
1589 1589
      * Renders the alert element template.
1590 1590
      */
1591
-    public function render_alert_template( $field ) {
1592
-        $restrict = $this->get_restrict_markup( $field, 'alert' );
1591
+    public function render_alert_template($field) {
1592
+        $restrict = $this->get_restrict_markup($field, 'alert');
1593 1593
         $text     = "$field.text";
1594 1594
         echo "
1595 1595
             <div $restrict class='alert' :class='$field.class' role='alert'>
@@ -1604,15 +1604,15 @@  discard block
 block discarded – undo
1604 1604
     /**
1605 1605
      * Renders the alert element on the frontend.
1606 1606
      */
1607
-    public function frontend_render_alert_template( $field ) {
1607
+    public function frontend_render_alert_template($field) {
1608 1608
         
1609 1609
         echo "<div class='form-group'>";
1610 1610
 
1611 1611
         echo aui()->alert(
1612 1612
             array(
1613
-                'content'     => wp_kses_post( $field['text'] ),
1613
+                'content'     => wp_kses_post($field['text']),
1614 1614
                 'dismissible' => $field['dismissible'],
1615
-                'type'        => str_replace( 'alert-', '', $field['class'] ),
1615
+                'type'        => str_replace('alert-', '', $field['class']),
1616 1616
             )
1617 1617
         );
1618 1618
 
@@ -1623,14 +1623,14 @@  discard block
 block discarded – undo
1623 1623
     /**
1624 1624
      * Renders the alert element template.
1625 1625
      */
1626
-    public function edit_alert_template( $field ) {
1627
-        $restrict = $this->get_restrict_markup( $field, 'alert' );
1628
-        $label    = __( 'Alert Text', 'invoicing' );
1629
-        $label2   = esc_attr__( 'Enter your alert text here', 'invoicing' );
1626
+    public function edit_alert_template($field) {
1627
+        $restrict = $this->get_restrict_markup($field, 'alert');
1628
+        $label    = __('Alert Text', 'invoicing');
1629
+        $label2   = esc_attr__('Enter your alert text here', 'invoicing');
1630 1630
         $id       = $field . '.id + "_edit"';
1631
-        $label3   = __( 'Is Dismissible?', 'invoicing' );
1631
+        $label3   = __('Is Dismissible?', 'invoicing');
1632 1632
         $id2      = $field . '.id + "_edit2"';
1633
-        $label4   = esc_attr__( 'Alert Type', 'invoicing' );
1633
+        $label4   = esc_attr__('Alert Type', 'invoicing');
1634 1634
         $id3      = $field . '.id + "_edit3"';
1635 1635
         echo "
1636 1636
             <div $restrict>
@@ -1646,14 +1646,14 @@  discard block
 block discarded – undo
1646 1646
                     <label :for='$id3'>$label4</label>
1647 1647
 
1648 1648
                     <select class='form-control custom-select' :id='$id3' v-model='$field.class'>
1649
-                        <option value='alert-primary'>"   . __( 'Primary', 'invoicing' ) ."</option>
1650
-                        <option value='alert-secondary'>" . __( 'Secondary', 'invoicing' ) ."</option>
1651
-                        <option value='alert-success'>"   . __( 'Success', 'invoicing' ) ."</option>
1652
-                        <option value='alert-danger'>"    . __( 'Danger', 'invoicing' ) ."</option>
1653
-                        <option value='alert-warning'>"   . __( 'Warning', 'invoicing' ) ."</option>
1654
-                        <option value='alert-info'>"      . __( 'Info', 'invoicing' ) ."</option>
1655
-                        <option value='alert-light'>"     . __( 'Light', 'invoicing' ) ."</option>
1656
-                        <option value='alert-dark'>"      . __( 'Dark', 'invoicing' ) ."</option>
1649
+                        <option value='alert-primary'>" . __('Primary', 'invoicing') . "</option>
1650
+                        <option value='alert-secondary'>" . __('Secondary', 'invoicing') . "</option>
1651
+                        <option value='alert-success'>"   . __('Success', 'invoicing') . "</option>
1652
+                        <option value='alert-danger'>"    . __('Danger', 'invoicing') . "</option>
1653
+                        <option value='alert-warning'>"   . __('Warning', 'invoicing') . "</option>
1654
+                        <option value='alert-info'>"      . __('Info', 'invoicing') . "</option>
1655
+                        <option value='alert-light'>"     . __('Light', 'invoicing') . "</option>
1656
+                        <option value='alert-dark'>"      . __('Dark', 'invoicing') . "</option>
1657 1657
                     </select>
1658 1658
                 </div>
1659 1659
             </div>
@@ -1664,8 +1664,8 @@  discard block
 block discarded – undo
1664 1664
     /**
1665 1665
      * Renders the discount element template.
1666 1666
      */
1667
-    public function render_discount_template( $field ) {
1668
-        $restrict  = $this->get_restrict_markup( $field, 'discount' );
1667
+    public function render_discount_template($field) {
1668
+        $restrict = $this->get_restrict_markup($field, 'discount');
1669 1669
         ?>
1670 1670
 
1671 1671
             <div <?php echo $restrict; ?> class="discount_field  border rounded p-3">
@@ -1682,13 +1682,13 @@  discard block
 block discarded – undo
1682 1682
     /**
1683 1683
      * Renders the discount element on the frontend.
1684 1684
      */
1685
-    public function frontend_render_discount_template( $field ) {
1685
+    public function frontend_render_discount_template($field) {
1686 1686
         
1687
-        $placeholder = esc_attr( $field['input_label'] );
1688
-        $label       = sanitize_text_field( $field['button_label'] );
1687
+        $placeholder = esc_attr($field['input_label']);
1688
+        $label       = sanitize_text_field($field['button_label']);
1689 1689
         $description = '';
1690 1690
 
1691
-        if ( ! empty( $field['description'] ) ) {
1691
+        if (!empty($field['description'])) {
1692 1692
             $description = "<small class='form-text text-muted'>{$field['description']}</small>";
1693 1693
         }
1694 1694
 ?>
@@ -1709,12 +1709,12 @@  discard block
 block discarded – undo
1709 1709
     /**
1710 1710
      * Renders the discount element template.
1711 1711
      */
1712
-    public function edit_discount_template( $field ) {
1713
-        $restrict = $this->get_restrict_markup( $field, 'discount' );
1714
-        $label    = __( 'Discount Input Placeholder', 'invoicing' );
1715
-        $label2   = __( 'Help Text', 'invoicing' );
1716
-        $label3   = esc_attr__( 'Add some help text for this field', 'invoicing' );
1717
-        $label4   = __( 'Button Text', 'invoicing' );
1712
+    public function edit_discount_template($field) {
1713
+        $restrict = $this->get_restrict_markup($field, 'discount');
1714
+        $label    = __('Discount Input Placeholder', 'invoicing');
1715
+        $label2   = __('Help Text', 'invoicing');
1716
+        $label3   = esc_attr__('Add some help text for this field', 'invoicing');
1717
+        $label4   = __('Button Text', 'invoicing');
1718 1718
         $id       = $field . '.id + "_edit"';
1719 1719
         $id2      = $field . '.id + "_edit2"';
1720 1720
         $id3      = $field . '.id + "_edit3"';
@@ -1743,48 +1743,48 @@  discard block
 block discarded – undo
1743 1743
     /**
1744 1744
      * Renders the items element template.
1745 1745
      */
1746
-    public function render_items_template( $field ) {
1747
-        $restrict  = $this->get_restrict_markup( $field, 'items' );
1748
-        $label     = __( 'Item totals will appear here. Click to set items.', 'invoicing' );
1746
+    public function render_items_template($field) {
1747
+        $restrict  = $this->get_restrict_markup($field, 'items');
1748
+        $label     = __('Item totals will appear here. Click to set items.', 'invoicing');
1749 1749
         echo "<div $restrict class='item_totals p-4 bg-warning text-center'>$label</div>";
1750 1750
     }
1751 1751
 
1752 1752
     /**
1753 1753
      * Renders the items element on the frontend.
1754 1754
      */
1755
-    public function frontend_render_items_template( $field, $items ) {
1755
+    public function frontend_render_items_template($field, $items) {
1756 1756
         
1757 1757
         echo "<div class='form-group item_totals'>";
1758 1758
         
1759
-        $id = esc_attr( $field['id'] );
1760
-        if ( 'total' == $field[ 'items_type' ] ) {
1759
+        $id = esc_attr($field['id']);
1760
+        if ('total' == $field['items_type']) {
1761 1761
             $total = 0;
1762 1762
 
1763 1763
             ?>
1764 1764
             <div class="border item_totals_type_total">
1765 1765
 
1766 1766
                 <?php
1767
-                    foreach( $items as $item ) {
1768
-                        $total = $total + floatval( $item['price'] );
1767
+                    foreach ($items as $item) {
1768
+                        $total = $total + floatval($item['price']);
1769 1769
 
1770 1770
                         $class  = 'col-8';
1771 1771
                         $class2 = '';
1772 1772
 
1773
-                        if ( ! empty( $item['allow_quantities'] ) ) {
1773
+                        if (!empty($item['allow_quantities'])) {
1774 1774
                             $class = 'col-6 pt-2';
1775 1775
                             $class2 = 'pt-2';
1776 1776
                         }
1777 1777
 
1778
-                        if ( ! empty( $item['custom_price'] ) ) {
1778
+                        if (!empty($item['custom_price'])) {
1779 1779
                             $class .= ' pt-2';
1780 1780
                         }
1781 1781
             
1782 1782
                 ?>
1783 1783
                     <div  class="item_totals_item">
1784 1784
                         <div class='row pl-2 pr-2 pt-2'>
1785
-                            <div class='<?php echo $class; ?>'><?php echo esc_html( $item['title'] ) ?></div>
1785
+                            <div class='<?php echo $class; ?>'><?php echo esc_html($item['title']) ?></div>
1786 1786
 
1787
-                            <?php  if ( ! empty( $item['allow_quantities'] ) ) { ?>
1787
+                            <?php  if (!empty($item['allow_quantities'])) { ?>
1788 1788
 
1789 1789
                                 <div class='col-2'>
1790 1790
                                     <input name='wpinv-item-<?php echo (int) $item['id']; ?>-quantity' type='number' class='form-control wpinv-item-quantity-input pr-1' value='1' min='1' required>
@@ -1792,11 +1792,11 @@  discard block
 block discarded – undo
1792 1792
 
1793 1793
                             <?php } else { ?>
1794 1794
                                 <input type='hidden' class='wpinv-item-quantity-input' value='1'>
1795
-                            <?php } if ( empty( $item['custom_price'] ) ) { ?>
1795
+                            <?php } if (empty($item['custom_price'])) { ?>
1796 1796
 
1797 1797
                                 <div class='col-4 <?php echo $class2; ?>'>
1798
-                                    <?php echo wpinv_price( wpinv_format_amount( $item['price'] ) ) ?>
1799
-                                    <input name='wpinv-items[<?php echo (int) $item['id']; ?>]' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval( $item['price'] ); ?>'>
1798
+                                    <?php echo wpinv_price(wpinv_format_amount($item['price'])) ?>
1799
+                                    <input name='wpinv-items[<?php echo (int) $item['id']; ?>]' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval($item['price']); ?>'>
1800 1800
                                 </div>
1801 1801
 
1802 1802
                             <?php } else {?>
@@ -1804,15 +1804,15 @@  discard block
 block discarded – undo
1804 1804
                                 <div class='col-4'>
1805 1805
                                     <div class='input-group'>
1806 1806
 
1807
-                                        <?php if ( 'left' == wpinv_currency_position() ) { ?>
1807
+                                        <?php if ('left' == wpinv_currency_position()) { ?>
1808 1808
                                             <div class='input-group-prepend'>
1809 1809
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
1810 1810
                                             </div>
1811 1811
                                         <?php } ?>
1812 1812
 
1813
-                                        <input type='number' name='wpinv-items[<?php echo (int) $item['id']; ?>]' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval( $item['price'] ); ?>' value='<?php echo floatval( $item['price'] ); ?>' min='<?php echo intval( $item['minimum_price'] ); ?>'>
1813
+                                        <input type='number' name='wpinv-items[<?php echo (int) $item['id']; ?>]' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval($item['price']); ?>' value='<?php echo floatval($item['price']); ?>' min='<?php echo intval($item['minimum_price']); ?>'>
1814 1814
                                     
1815
-                                        <?php if ( 'left' != wpinv_currency_position() ) { ?>
1815
+                                        <?php if ('left' != wpinv_currency_position()) { ?>
1816 1816
                                             <div class='input-group-append'>
1817 1817
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
1818 1818
                                             </div>
@@ -1823,38 +1823,38 @@  discard block
 block discarded – undo
1823 1823
                             <?php } ?>
1824 1824
 
1825 1825
                         </div>
1826
-                        <?php if ( ! empty( $item['description'] )) { ?>
1827
-                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post( $item['description'] ); ?></small>
1826
+                        <?php if (!empty($item['description'])) { ?>
1827
+                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post($item['description']); ?></small>
1828 1828
                         <?php } ?>
1829 1829
                     </div>
1830 1830
                 <?php } ?>
1831 1831
 
1832 1832
                 <div class='mt-4 border-top item_totals_total'>
1833 1833
                     <div class='row p-2'>
1834
-                        <div class='col-8'><strong class='mr-5'><?php _e( 'Total', 'invoicing' ); ?></strong></div>
1835
-                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price( wpinv_format_amount( $total ) ) ?></strong></div>
1834
+                        <div class='col-8'><strong class='mr-5'><?php _e('Total', 'invoicing'); ?></strong></div>
1835
+                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price(wpinv_format_amount($total)) ?></strong></div>
1836 1836
                     </div>
1837 1837
                 </div>
1838 1838
 
1839 1839
             </div>
1840 1840
         <?php } ?>
1841 1841
 
1842
-        <?php if ( 'radio' == $field[ 'items_type' ] ) { ?>
1842
+        <?php if ('radio' == $field['items_type']) { ?>
1843 1843
             <div class="item_totals_type_radio">
1844 1844
 
1845 1845
                 <?php
1846
-                    foreach( $items as $index => $item ) {
1846
+                    foreach ($items as $index => $item) {
1847 1847
                 
1848
-                        if ( ! empty( $item['required'] ) ) {
1848
+                        if (!empty($item['required'])) {
1849 1849
                             continue;
1850 1850
                         }
1851 1851
                 ?>
1852 1852
                     <div  class="form-check">
1853
-                        <input class='form-check-input wpinv-items-selector' <?php checked( ! isset( $selected_radio_item ) ); $selected_radio_item = 1; ?> type='radio' value='<?php echo $item['id']; ?>' id='<?php echo $id . $index; ?>' name='wpinv-payment-form-selected-item'>
1854
-                        <label class='form-check-label' for='<?php echo $id . $index; ?>'><?php echo sanitize_text_field( $item['title'] ); ?>&nbsp;<strong><?php echo wpinv_price( wpinv_format_amount( (float) sanitize_text_field(  $item['price'] ) ) ); ?></strong></label>
1853
+                        <input class='form-check-input wpinv-items-selector' <?php checked(!isset($selected_radio_item)); $selected_radio_item = 1; ?> type='radio' value='<?php echo $item['id']; ?>' id='<?php echo $id . $index; ?>' name='wpinv-payment-form-selected-item'>
1854
+                        <label class='form-check-label' for='<?php echo $id . $index; ?>'><?php echo sanitize_text_field($item['title']); ?>&nbsp;<strong><?php echo wpinv_price(wpinv_format_amount((float) sanitize_text_field($item['price']))); ?></strong></label>
1855 1855
                     </div>
1856
-                    <?php if ( ! empty( $item['description'] )) { ?>
1857
-                        <small class='form-text text-muted pl-4 pr-2 m-0'><?php echo wp_kses_post( $item['description'] ); ?></small>
1856
+                    <?php if (!empty($item['description'])) { ?>
1857
+                        <small class='form-text text-muted pl-4 pr-2 m-0'><?php echo wp_kses_post($item['description']); ?></small>
1858 1858
                     <?php } ?>
1859 1859
                 <?php } ?>
1860 1860
 
@@ -1864,29 +1864,29 @@  discard block
 block discarded – undo
1864 1864
 
1865 1865
                         $total = 0;
1866 1866
 
1867
-                        foreach ( $items as $item ) {
1867
+                        foreach ($items as $item) {
1868 1868
 
1869 1869
                             $class  = 'col-8';
1870 1870
                             $class2 = '';
1871 1871
 
1872
-                            if ( ! empty( $item['allow_quantities'] ) ) {
1872
+                            if (!empty($item['allow_quantities'])) {
1873 1873
                                 $class = 'col-6 pt-2';
1874 1874
                                 $class2 = 'pt-2';
1875 1875
                             }
1876 1876
 
1877
-                            if ( ! empty( $item['custom_price'] ) ) {
1877
+                            if (!empty($item['custom_price'])) {
1878 1878
                                 $class .= ' pt-2';
1879 1879
                             }
1880 1880
 
1881 1881
                             $class3 = 'd-none';
1882 1882
                             $name   = '';
1883
-                            if ( ! empty( $item['required'] ) || ! isset( $totals_selected_radio_item ) ) {
1883
+                            if (!empty($item['required']) || !isset($totals_selected_radio_item)) {
1884 1884
 
1885
-                                $total = $total + floatval( $item['price'] );
1885
+                                $total = $total + floatval($item['price']);
1886 1886
                                 $class3 = '';
1887 1887
                                 $name   = "wpinv-items[{$item['id']}]";
1888 1888
 
1889
-                                if ( empty( $item['required'] ) ) {
1889
+                                if (empty($item['required'])) {
1890 1890
                                     $totals_selected_radio_item = 1;
1891 1891
                                 }
1892 1892
 
@@ -1898,9 +1898,9 @@  discard block
 block discarded – undo
1898 1898
 
1899 1899
                     <div  class="item_totals_item <?php echo $class3; ?>" data-id="<?php echo (int) $item['id']; ?>">
1900 1900
                         <div class='row pl-2 pr-2 pt-2'>
1901
-                            <div class='<?php echo $class; ?>'><?php echo esc_html( $item['title'] ) ?></div>
1901
+                            <div class='<?php echo $class; ?>'><?php echo esc_html($item['title']) ?></div>
1902 1902
 
1903
-                            <?php  if ( ! empty( $item['allow_quantities'] ) ) { ?>
1903
+                            <?php  if (!empty($item['allow_quantities'])) { ?>
1904 1904
 
1905 1905
                                 <div class='col-2'>
1906 1906
                                     <input name='wpinv-item-<?php echo (int) $item['id']; ?>-quantity' type='number' class='form-control wpinv-item-quantity-input pr-1' value='1' min='1' required>
@@ -1908,11 +1908,11 @@  discard block
 block discarded – undo
1908 1908
 
1909 1909
                             <?php } else { ?>
1910 1910
                                 <input type='hidden' class='wpinv-item-quantity-input' value='1'>
1911
-                            <?php } if ( empty( $item['custom_price'] ) ) { ?>
1911
+                            <?php } if (empty($item['custom_price'])) { ?>
1912 1912
 
1913 1913
                                 <div class='col-4 <?php echo $class2; ?>'>
1914
-                                    <?php echo wpinv_price( wpinv_format_amount( $item['price'] ) ) ?>
1915
-                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval( $item['price'] ); ?>'>
1914
+                                    <?php echo wpinv_price(wpinv_format_amount($item['price'])) ?>
1915
+                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval($item['price']); ?>'>
1916 1916
                                 </div>
1917 1917
 
1918 1918
                             <?php } else {?>
@@ -1920,15 +1920,15 @@  discard block
 block discarded – undo
1920 1920
                                 <div class='col-4'>
1921 1921
                                     <div class='input-group'>
1922 1922
 
1923
-                                        <?php if ( 'left' == wpinv_currency_position() ) { ?>
1923
+                                        <?php if ('left' == wpinv_currency_position()) { ?>
1924 1924
                                             <div class='input-group-prepend'>
1925 1925
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
1926 1926
                                             </div>
1927 1927
                                         <?php } ?>
1928 1928
 
1929
-                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval( $item['price'] ); ?>' value='<?php echo floatval( $item['price'] ); ?>' min='<?php echo intval( $item['minimum_price'] ); ?>'>
1929
+                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval($item['price']); ?>' value='<?php echo floatval($item['price']); ?>' min='<?php echo intval($item['minimum_price']); ?>'>
1930 1930
                                     
1931
-                                        <?php if ( 'left' != wpinv_currency_position() ) { ?>
1931
+                                        <?php if ('left' != wpinv_currency_position()) { ?>
1932 1932
                                             <div class='input-group-append'>
1933 1933
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
1934 1934
                                             </div>
@@ -1939,16 +1939,16 @@  discard block
 block discarded – undo
1939 1939
                             <?php } ?>
1940 1940
 
1941 1941
                         </div>
1942
-                        <?php if ( ! empty( $item['description'] )) { ?>
1943
-                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post( $item['description'] ); ?></small>
1942
+                        <?php if (!empty($item['description'])) { ?>
1943
+                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post($item['description']); ?></small>
1944 1944
                         <?php } ?>
1945 1945
                     </div>
1946 1946
                 <?php } ?>
1947 1947
 
1948 1948
                 <div class='mt-4 border-top item_totals_total'>
1949 1949
                     <div class='row p-2'>
1950
-                        <div class='col-8'><strong class='mr-5'><?php _e( 'Total', 'invoicing' ); ?></strong></div>
1951
-                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price( wpinv_format_amount( $total ) ) ?></strong></div>
1950
+                        <div class='col-8'><strong class='mr-5'><?php _e('Total', 'invoicing'); ?></strong></div>
1951
+                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price(wpinv_format_amount($total)) ?></strong></div>
1952 1952
                     </div>
1953 1953
                 </div>
1954 1954
 
@@ -1956,22 +1956,22 @@  discard block
 block discarded – undo
1956 1956
             </div>
1957 1957
         <?php } ?>
1958 1958
 
1959
-        <?php if ( 'checkbox' == $field[ 'items_type' ] ) { ?>
1959
+        <?php if ('checkbox' == $field['items_type']) { ?>
1960 1960
 
1961 1961
             <div class="item_totals_type_checkbox">
1962 1962
 
1963 1963
                 <?php
1964
-                    foreach ( $items as $index => $item ) {
1964
+                    foreach ($items as $index => $item) {
1965 1965
 
1966
-                        if ( ! empty( $item['required'] ) ) {
1966
+                        if (!empty($item['required'])) {
1967 1967
                             continue;
1968 1968
                         }
1969 1969
 
1970
-                        $title = sanitize_text_field(  $item['title'] );
1971
-                        $price = wpinv_price( wpinv_format_amount( (float) sanitize_text_field(  $item['price'] ) ) );
1972
-                        $item_id    = esc_attr( $id . "_$index" );
1973
-                        $value = esc_attr( $item['id'] );
1974
-                        $checked = checked( ! isset( $selected_checkbox_item ), true, false );
1970
+                        $title = sanitize_text_field($item['title']);
1971
+                        $price = wpinv_price(wpinv_format_amount((float) sanitize_text_field($item['price'])));
1972
+                        $item_id = esc_attr($id . "_$index");
1973
+                        $value = esc_attr($item['id']);
1974
+                        $checked = checked(!isset($selected_checkbox_item), true, false);
1975 1975
                         $selected_checkbox_item = 1;
1976 1976
 
1977 1977
                         echo "
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
                                 <label for='$item_id' class='custom-control-label'>$title &nbsp; ($price)</label>
1981 1981
                             </div>";
1982 1982
 
1983
-                        if ( ! empty( $item['description'] ) ) {
1983
+                        if (!empty($item['description'])) {
1984 1984
                             echo "<small class='form-text text-muted'>{$item['description']}</small>";
1985 1985
                         }
1986 1986
                     }
@@ -1992,29 +1992,29 @@  discard block
 block discarded – undo
1992 1992
 
1993 1993
                         $total = 0;
1994 1994
 
1995
-                        foreach ( $items as $item ) {
1995
+                        foreach ($items as $item) {
1996 1996
 
1997 1997
                             $class  = 'col-8';
1998 1998
                             $class2 = '';
1999 1999
 
2000
-                            if ( ! empty( $item['allow_quantities'] ) ) {
2000
+                            if (!empty($item['allow_quantities'])) {
2001 2001
                                 $class = 'col-6 pt-2';
2002 2002
                                 $class2 = 'pt-2';
2003 2003
                             }
2004 2004
 
2005
-                            if ( ! empty( $item['custom_price'] ) ) {
2005
+                            if (!empty($item['custom_price'])) {
2006 2006
                                 $class .= ' pt-2';
2007 2007
                             }
2008 2008
 
2009 2009
                             $class3 = 'd-none';
2010
-                            $name  = '';
2011
-                            if ( ! empty( $item['required'] ) || ! isset( $totals_selected_checkbox_item ) ) {
2010
+                            $name = '';
2011
+                            if (!empty($item['required']) || !isset($totals_selected_checkbox_item)) {
2012 2012
 
2013
-                                $total = $total + floatval( $item['price'] );
2013
+                                $total = $total + floatval($item['price']);
2014 2014
                                 $class3 = '';
2015 2015
                                 $name  = "wpinv-items[{$item['id']}]";
2016 2016
 
2017
-                                if ( empty( $item['required'] ) ) {
2017
+                                if (empty($item['required'])) {
2018 2018
                                     $totals_selected_checkbox_item = 1;
2019 2019
                                 }
2020 2020
 
@@ -2026,9 +2026,9 @@  discard block
 block discarded – undo
2026 2026
 
2027 2027
                     <div  class="item_totals_item <?php echo $class3; ?>" data-id="<?php echo (int) $item['id']; ?>">
2028 2028
                         <div class='row pl-2 pr-2 pt-2'>
2029
-                            <div class='<?php echo $class; ?>'><?php echo esc_html( $item['title'] ) ?></div>
2029
+                            <div class='<?php echo $class; ?>'><?php echo esc_html($item['title']) ?></div>
2030 2030
 
2031
-                            <?php  if ( ! empty( $item['allow_quantities'] ) ) { ?>
2031
+                            <?php  if (!empty($item['allow_quantities'])) { ?>
2032 2032
 
2033 2033
                                 <div class='col-2'>
2034 2034
                                     <input name='wpinv-item-<?php echo (int) $item['id']; ?>-quantity' type='number' class='form-control wpinv-item-quantity-input pr-1' value='1' min='1' required>
@@ -2036,11 +2036,11 @@  discard block
 block discarded – undo
2036 2036
 
2037 2037
                             <?php } else { ?>
2038 2038
                                 <input type='hidden' class='wpinv-item-quantity-input' value='1'>
2039
-                            <?php } if ( empty( $item['custom_price'] ) ) { ?>
2039
+                            <?php } if (empty($item['custom_price'])) { ?>
2040 2040
 
2041 2041
                                 <div class='col-4 <?php echo $class2; ?>'>
2042
-                                    <?php echo wpinv_price( wpinv_format_amount( $item['price'] ) ) ?>
2043
-                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval( $item['price'] ); ?>'>
2042
+                                    <?php echo wpinv_price(wpinv_format_amount($item['price'])) ?>
2043
+                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval($item['price']); ?>'>
2044 2044
                                 </div>
2045 2045
 
2046 2046
                             <?php } else {?>
@@ -2048,15 +2048,15 @@  discard block
 block discarded – undo
2048 2048
                                 <div class='col-4'>
2049 2049
                                     <div class='input-group'>
2050 2050
 
2051
-                                        <?php if ( 'left' == wpinv_currency_position() ) { ?>
2051
+                                        <?php if ('left' == wpinv_currency_position()) { ?>
2052 2052
                                             <div class='input-group-prepend'>
2053 2053
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
2054 2054
                                             </div>
2055 2055
                                         <?php } ?>
2056 2056
 
2057
-                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval( $item['price'] ); ?>' value='<?php echo floatval( $item['price'] ); ?>' min='<?php echo intval( $item['minimum_price'] ); ?>'>
2057
+                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval($item['price']); ?>' value='<?php echo floatval($item['price']); ?>' min='<?php echo intval($item['minimum_price']); ?>'>
2058 2058
                                     
2059
-                                        <?php if ( 'left' != wpinv_currency_position() ) { ?>
2059
+                                        <?php if ('left' != wpinv_currency_position()) { ?>
2060 2060
                                             <div class='input-group-append'>
2061 2061
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
2062 2062
                                             </div>
@@ -2067,23 +2067,23 @@  discard block
 block discarded – undo
2067 2067
                             <?php } ?>
2068 2068
 
2069 2069
                         </div>
2070
-                        <?php if ( ! empty( $item['description'] )) { ?>
2071
-                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post( $item['description'] ); ?></small>
2070
+                        <?php if (!empty($item['description'])) { ?>
2071
+                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post($item['description']); ?></small>
2072 2072
                         <?php } ?>
2073 2073
                     </div>
2074 2074
                 <?php } ?>
2075 2075
 
2076 2076
                 <div class='mt-4 border-top item_totals_total'>
2077 2077
                     <div class='row p-2'>
2078
-                        <div class='col-8'><strong class='mr-5'><?php _e( 'Total', 'invoicing' ); ?></strong></div>
2079
-                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price( wpinv_format_amount( $total ) ) ?></strong></div>
2078
+                        <div class='col-8'><strong class='mr-5'><?php _e('Total', 'invoicing'); ?></strong></div>
2079
+                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price(wpinv_format_amount($total)) ?></strong></div>
2080 2080
                     </div>
2081 2081
                 </div>
2082 2082
             </div>
2083 2083
             </div>
2084 2084
         <?php } ?>
2085 2085
 
2086
-        <?php if ( 'select' == $field[ 'items_type' ] ) { ?>
2086
+        <?php if ('select' == $field['items_type']) { ?>
2087 2087
 
2088 2088
             <div class="item_totals_type_select">
2089 2089
 
@@ -2091,17 +2091,17 @@  discard block
 block discarded – undo
2091 2091
 
2092 2092
                     $options  = array();
2093 2093
                     $selected = '';
2094
-                    foreach ( $items as $index => $item ) {
2094
+                    foreach ($items as $index => $item) {
2095 2095
 
2096
-                        if ( ! empty( $item['required'] ) ) {
2096
+                        if (!empty($item['required'])) {
2097 2097
                             continue;
2098 2098
                         }
2099 2099
 
2100
-                        $title = sanitize_text_field(  $item['title'] );
2101
-                        $price = wpinv_price( wpinv_format_amount( (float) sanitize_text_field(  $item['price'] ) ) );
2102
-                        $options[ $item['id'] ] = "$title &nbsp; ($price)";
2100
+                        $title = sanitize_text_field($item['title']);
2101
+                        $price = wpinv_price(wpinv_format_amount((float) sanitize_text_field($item['price'])));
2102
+                        $options[$item['id']] = "$title &nbsp; ($price)";
2103 2103
 
2104
-                        if ( ! isset( $selected_item ) ) {
2104
+                        if (!isset($selected_item)) {
2105 2105
                             $selected = $item['id'];
2106 2106
                             $selected_item = 1;
2107 2107
                         }
@@ -2112,7 +2112,7 @@  discard block
 block discarded – undo
2112 2112
                         array(
2113 2113
                                 'name'        => 'payment-form-items',
2114 2114
                                 'id'          => $id,
2115
-                                'placeholder' => __( 'Select an item', 'invoicing' ),
2115
+                                'placeholder' => __('Select an item', 'invoicing'),
2116 2116
                                 'no_wrap'     => true,
2117 2117
                                 'options'     => $options,
2118 2118
                                 'class'       => 'wpi_select2 wpinv-items-select-selector',
@@ -2127,29 +2127,29 @@  discard block
 block discarded – undo
2127 2127
 
2128 2128
                         $total = 0;
2129 2129
 
2130
-                        foreach ( $items as $item ) {
2130
+                        foreach ($items as $item) {
2131 2131
 
2132 2132
                             $class  = 'col-8';
2133 2133
                             $class2 = '';
2134 2134
 
2135
-                            if ( ! empty( $item['allow_quantities'] ) ) {
2135
+                            if (!empty($item['allow_quantities'])) {
2136 2136
                                 $class = 'col-6 pt-2';
2137 2137
                                 $class2 = 'pt-2';
2138 2138
                             }
2139 2139
 
2140
-                            if ( ! empty( $item['custom_price'] ) ) {
2140
+                            if (!empty($item['custom_price'])) {
2141 2141
                                 $class .= ' pt-2';
2142 2142
                             }
2143 2143
 
2144 2144
                             $class3 = 'd-none';
2145
-                            $name  = '';
2146
-                            if ( ! empty( $item['required'] ) || ! isset( $totals_selected_select_item ) ) {
2145
+                            $name = '';
2146
+                            if (!empty($item['required']) || !isset($totals_selected_select_item)) {
2147 2147
 
2148
-                                $total = $total + floatval( $item['price'] );
2148
+                                $total = $total + floatval($item['price']);
2149 2149
                                 $class3 = '';
2150 2150
                                 $name  = "wpinv-items[{$item['id']}]";
2151 2151
 
2152
-                                if ( empty( $item['required'] ) ) {
2152
+                                if (empty($item['required'])) {
2153 2153
                                     $totals_selected_select_item = 1;
2154 2154
                                 }
2155 2155
 
@@ -2161,9 +2161,9 @@  discard block
 block discarded – undo
2161 2161
 
2162 2162
                     <div  class="item_totals_item <?php echo $class3; ?>" data-id="<?php echo (int) $item['id']; ?>">
2163 2163
                         <div class='row pl-2 pr-2 pt-2'>
2164
-                            <div class='<?php echo $class; ?>'><?php echo esc_html( $item['title'] ) ?></div>
2164
+                            <div class='<?php echo $class; ?>'><?php echo esc_html($item['title']) ?></div>
2165 2165
 
2166
-                            <?php  if ( ! empty( $item['allow_quantities'] ) ) { ?>
2166
+                            <?php  if (!empty($item['allow_quantities'])) { ?>
2167 2167
 
2168 2168
                                 <div class='col-2'>
2169 2169
                                     <input name='wpinv-item-<?php echo (int) $item['id']; ?>-quantity' type='number' class='form-control wpinv-item-quantity-input pr-1' value='1' min='1' required>
@@ -2171,11 +2171,11 @@  discard block
 block discarded – undo
2171 2171
 
2172 2172
                             <?php } else { ?>
2173 2173
                                 <input type='hidden' class='wpinv-item-quantity-input' value='1'>
2174
-                            <?php } if ( empty( $item['custom_price'] ) ) { ?>
2174
+                            <?php } if (empty($item['custom_price'])) { ?>
2175 2175
 
2176 2176
                                 <div class='col-4 <?php echo $class2; ?>'>
2177
-                                    <?php echo wpinv_price( wpinv_format_amount( $item['price'] ) ) ?>
2178
-                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval( $item['price'] ); ?>'>
2177
+                                    <?php echo wpinv_price(wpinv_format_amount($item['price'])) ?>
2178
+                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval($item['price']); ?>'>
2179 2179
                                 </div>
2180 2180
 
2181 2181
                             <?php } else {?>
@@ -2183,15 +2183,15 @@  discard block
 block discarded – undo
2183 2183
                                 <div class='col-4'>
2184 2184
                                     <div class='input-group'>
2185 2185
 
2186
-                                        <?php if ( 'left' == wpinv_currency_position() ) { ?>
2186
+                                        <?php if ('left' == wpinv_currency_position()) { ?>
2187 2187
                                             <div class='input-group-prepend'>
2188 2188
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
2189 2189
                                             </div>
2190 2190
                                         <?php } ?>
2191 2191
 
2192
-                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval( $item['price'] ); ?>' value='<?php echo floatval( $item['price'] ); ?>' min='<?php echo intval( $item['minimum_price'] ); ?>'>
2192
+                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval($item['price']); ?>' value='<?php echo floatval($item['price']); ?>' min='<?php echo intval($item['minimum_price']); ?>'>
2193 2193
                                     
2194
-                                        <?php if ( 'left' != wpinv_currency_position() ) { ?>
2194
+                                        <?php if ('left' != wpinv_currency_position()) { ?>
2195 2195
                                             <div class='input-group-append'>
2196 2196
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
2197 2197
                                             </div>
@@ -2202,23 +2202,23 @@  discard block
 block discarded – undo
2202 2202
                             <?php } ?>
2203 2203
 
2204 2204
                         </div>
2205
-                        <?php if ( ! empty( $item['description'] )) { ?>
2206
-                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post( $item['description'] ); ?></small>
2205
+                        <?php if (!empty($item['description'])) { ?>
2206
+                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post($item['description']); ?></small>
2207 2207
                         <?php } ?>
2208 2208
                     </div>
2209 2209
                 <?php } ?>
2210 2210
 
2211 2211
                 <div class='mt-4 border-top item_totals_total'>
2212 2212
                     <div class='row p-2'>
2213
-                        <div class='col-8'><strong class='mr-5'><?php _e( 'Total', 'invoicing' ); ?></strong></div>
2214
-                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price( wpinv_format_amount( $total ) ) ?></strong></div>
2213
+                        <div class='col-8'><strong class='mr-5'><?php _e('Total', 'invoicing'); ?></strong></div>
2214
+                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price(wpinv_format_amount($total)) ?></strong></div>
2215 2215
                     </div>
2216 2216
                 </div>
2217 2217
 
2218 2218
             </div>
2219 2219
         <?php } ?>
2220 2220
 
2221
-        <?php if ( 'multi_select' == $field[ 'items_type' ] ) { ?>
2221
+        <?php if ('multi_select' == $field['items_type']) { ?>
2222 2222
 
2223 2223
             <div class="item_totals_type_multi_select">
2224 2224
 
@@ -2227,18 +2227,18 @@  discard block
 block discarded – undo
2227 2227
                     $options  = array();
2228 2228
                     $selected = array();
2229 2229
 
2230
-                    foreach ( $items as $index => $item ) {
2230
+                    foreach ($items as $index => $item) {
2231 2231
 
2232
-                        if ( ! empty( $item['required'] ) ) {
2232
+                        if (!empty($item['required'])) {
2233 2233
                             continue;
2234 2234
                         }
2235 2235
                     
2236
-                        $title = sanitize_text_field(  $item['title'] );
2237
-                        $price = wpinv_price( wpinv_format_amount( (float) sanitize_text_field(  $item['price'] ) ) );
2238
-                        $options[ $item['id'] ] = "$title &nbsp; ($price)";
2236
+                        $title = sanitize_text_field($item['title']);
2237
+                        $price = wpinv_price(wpinv_format_amount((float) sanitize_text_field($item['price'])));
2238
+                        $options[$item['id']] = "$title &nbsp; ($price)";
2239 2239
 
2240
-                        if ( ! isset( $selected_item ) ) {
2241
-                            $selected = array( $item['id'] );
2240
+                        if (!isset($selected_item)) {
2241
+                            $selected = array($item['id']);
2242 2242
                             $selected_item = 1;
2243 2243
                         }
2244 2244
 
@@ -2263,29 +2263,29 @@  discard block
 block discarded – undo
2263 2263
 
2264 2264
                         $total = 0;
2265 2265
 
2266
-                        foreach ( $items as $item ) {
2266
+                        foreach ($items as $item) {
2267 2267
 
2268 2268
                             $class  = 'col-8';
2269 2269
                             $class2 = '';
2270 2270
 
2271
-                            if ( ! empty( $item['allow_quantities'] ) ) {
2271
+                            if (!empty($item['allow_quantities'])) {
2272 2272
                                 $class = 'col-6 pt-2';
2273 2273
                                 $class2 = 'pt-2';
2274 2274
                             }
2275 2275
 
2276
-                            if ( ! empty( $item['custom_price'] ) ) {
2276
+                            if (!empty($item['custom_price'])) {
2277 2277
                                 $class .= ' pt-2';
2278 2278
                             }
2279 2279
 
2280 2280
                             $class3 = 'd-none';
2281
-                            $name  = '';
2282
-                            if ( ! empty( $item['required'] ) || ! isset( $totals_selected_select_item ) ) {
2281
+                            $name = '';
2282
+                            if (!empty($item['required']) || !isset($totals_selected_select_item)) {
2283 2283
 
2284
-                                $total = $total + floatval( $item['price'] );
2284
+                                $total = $total + floatval($item['price']);
2285 2285
                                 $class3 = '';
2286 2286
                                 $name  = "wpinv-items[{$item['id']}]";
2287 2287
 
2288
-                                if ( empty( $item['required'] ) ) {
2288
+                                if (empty($item['required'])) {
2289 2289
                                     $totals_selected_select_item = 1;
2290 2290
                                 }
2291 2291
 
@@ -2297,9 +2297,9 @@  discard block
 block discarded – undo
2297 2297
 
2298 2298
                     <div  class="item_totals_item <?php echo $class3; ?>" data-id="<?php echo (int) $item['id']; ?>">
2299 2299
                         <div class='row pl-2 pr-2 pt-2'>
2300
-                            <div class='<?php echo $class; ?>'><?php echo esc_html( $item['title'] ) ?></div>
2300
+                            <div class='<?php echo $class; ?>'><?php echo esc_html($item['title']) ?></div>
2301 2301
 
2302
-                            <?php  if ( ! empty( $item['allow_quantities'] ) ) { ?>
2302
+                            <?php  if (!empty($item['allow_quantities'])) { ?>
2303 2303
 
2304 2304
                                 <div class='col-2'>
2305 2305
                                     <input name='wpinv-item-<?php echo (int) $item['id']; ?>-quantity' type='number' class='form-control wpinv-item-quantity-input pr-1' value='1' min='1' required>
@@ -2307,11 +2307,11 @@  discard block
 block discarded – undo
2307 2307
 
2308 2308
                             <?php } else { ?>
2309 2309
                                 <input type='hidden' class='wpinv-item-quantity-input' value='1'>
2310
-                            <?php } if ( empty( $item['custom_price'] ) ) { ?>
2310
+                            <?php } if (empty($item['custom_price'])) { ?>
2311 2311
 
2312 2312
                                 <div class='col-4 <?php echo $class2; ?>'>
2313
-                                    <?php echo wpinv_price( wpinv_format_amount( $item['price'] ) ) ?>
2314
-                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval( $item['price'] ); ?>'>
2313
+                                    <?php echo wpinv_price(wpinv_format_amount($item['price'])) ?>
2314
+                                    <input name='<?php echo $name; ?>' type='hidden' class='wpinv-item-price-input' value='<?php echo floatval($item['price']); ?>'>
2315 2315
                                 </div>
2316 2316
 
2317 2317
                             <?php } else {?>
@@ -2319,15 +2319,15 @@  discard block
 block discarded – undo
2319 2319
                                 <div class='col-4'>
2320 2320
                                     <div class='input-group'>
2321 2321
 
2322
-                                        <?php if ( 'left' == wpinv_currency_position() ) { ?>
2322
+                                        <?php if ('left' == wpinv_currency_position()) { ?>
2323 2323
                                             <div class='input-group-prepend'>
2324 2324
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
2325 2325
                                             </div>
2326 2326
                                         <?php } ?>
2327 2327
 
2328
-                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval( $item['price'] ); ?>' value='<?php echo floatval( $item['price'] ); ?>' min='<?php echo intval( $item['minimum_price'] ); ?>'>
2328
+                                        <input type='number' name='<?php echo $name; ?>' class='form-control wpinv-item-price-input' placeholder='<?php echo floatval($item['price']); ?>' value='<?php echo floatval($item['price']); ?>' min='<?php echo intval($item['minimum_price']); ?>'>
2329 2329
                                     
2330
-                                        <?php if ( 'left' != wpinv_currency_position() ) { ?>
2330
+                                        <?php if ('left' != wpinv_currency_position()) { ?>
2331 2331
                                             <div class='input-group-append'>
2332 2332
                                                 <span class='input-group-text'><?php echo wpinv_currency_symbol(); ?></span>
2333 2333
                                             </div>
@@ -2338,23 +2338,23 @@  discard block
 block discarded – undo
2338 2338
                             <?php } ?>
2339 2339
 
2340 2340
                         </div>
2341
-                        <?php if ( ! empty( $item['description'] )) { ?>
2342
-                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post( $item['description'] ); ?></small>
2341
+                        <?php if (!empty($item['description'])) { ?>
2342
+                            <small class='form-text text-muted pl-2 pr-2 m-0'><?php echo wp_kses_post($item['description']); ?></small>
2343 2343
                         <?php } ?>
2344 2344
                     </div>
2345 2345
                 <?php } ?>
2346 2346
 
2347 2347
                 <div class='mt-4 border-top item_totals_total'>
2348 2348
                     <div class='row p-2'>
2349
-                        <div class='col-8'><strong class='mr-5'><?php _e( 'Total', 'invoicing' ); ?></strong></div>
2350
-                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price( wpinv_format_amount( $total ) ) ?></strong></div>
2349
+                        <div class='col-8'><strong class='mr-5'><?php _e('Total', 'invoicing'); ?></strong></div>
2350
+                        <div class='col-4'><strong class='wpinv-items-total' data-currency='<?php echo wpinv_currency_symbol(); ?>' data-currency-position='<?php echo wpinv_currency_position(); ?>'><?php echo wpinv_price(wpinv_format_amount($total)) ?></strong></div>
2351 2351
                     </div>
2352 2352
                 </div>
2353 2353
 
2354 2354
             </div>
2355 2355
         <?php } ?>
2356
-        <?php if ( ! empty( $field[ 'description' ] ) ) { ?>
2357
-            <small class='form-text text-muted'><?php echo wp_kses_post( $field[ 'description' ] ); ?></small>
2356
+        <?php if (!empty($field['description'])) { ?>
2357
+            <small class='form-text text-muted'><?php echo wp_kses_post($field['description']); ?></small>
2358 2358
         <?php } ?>
2359 2359
         </div>
2360 2360
         <?php
@@ -2363,20 +2363,20 @@  discard block
 block discarded – undo
2363 2363
     /**
2364 2364
      * Renders the items element template.
2365 2365
      */
2366
-    public function edit_items_template( $field ) {
2367
-        $restrict = $this->get_restrict_markup( $field, 'items' );
2368
-        $label    = __( 'Let customers...', 'invoicing' );
2369
-        $label2   = __( 'Available Items', 'invoicing' );
2370
-        $label3   = esc_attr__( 'Add some help text for this element', 'invoicing' );
2366
+    public function edit_items_template($field) {
2367
+        $restrict = $this->get_restrict_markup($field, 'items');
2368
+        $label    = __('Let customers...', 'invoicing');
2369
+        $label2   = __('Available Items', 'invoicing');
2370
+        $label3   = esc_attr__('Add some help text for this element', 'invoicing');
2371 2371
         $id       = $field . '.id + "_edit"';
2372 2372
         $id2      = $field . '.id + "_edit2"';
2373 2373
         $id3      = $field . '.id + "_edit3"';
2374 2374
         $id4      = $field . '.id + "_edit4"';
2375
-        $label4   = esc_attr__( 'This will be shown to the customer as the recommended price', 'invoicing' );
2376
-        $label5   = esc_attr__( 'Allow users to pay what they want', 'invoicing' );
2377
-        $label6   = esc_attr__( 'Enter the minimum price that a user can pay', 'invoicing' );
2378
-        $label7   = esc_attr__( 'Allow users to buy several quantities', 'invoicing' );
2379
-        $label8   = esc_attr__( 'This item is required', 'invoicing' );
2375
+        $label4   = esc_attr__('This will be shown to the customer as the recommended price', 'invoicing');
2376
+        $label5   = esc_attr__('Allow users to pay what they want', 'invoicing');
2377
+        $label6   = esc_attr__('Enter the minimum price that a user can pay', 'invoicing');
2378
+        $label7   = esc_attr__('Allow users to buy several quantities', 'invoicing');
2379
+        $label8   = esc_attr__('This item is required', 'invoicing');
2380 2380
         echo "<div $restrict>
2381 2381
 
2382 2382
                 <label>$label2</label>
@@ -2446,7 +2446,7 @@  discard block
 block discarded – undo
2446 2446
                 <div class='form-group mt-2'>
2447 2447
 
2448 2448
                     <select class='form-control custom-select' v-model='selected_item' @change='addSelectedItem'>
2449
-                        <option value=''>"        . __( 'Add an existing item to the form', 'invoicing' ) ."</option>
2449
+                        <option value=''>" . __('Add an existing item to the form', 'invoicing') . "</option>
2450 2450
                         <option v-for='(item, index) in all_items' :value='index'>{{item.title}}</option>
2451 2451
                     </select>
2452 2452
 
@@ -2461,11 +2461,11 @@  discard block
 block discarded – undo
2461 2461
                     <label :for='$id2'>$label</label>
2462 2462
 
2463 2463
                     <select class='form-control custom-select' :id='$id2' v-model='$field.items_type'>
2464
-                        <option value='total'>"        . __( 'Buy all items on the list', 'invoicing' ) ."</option>
2465
-                        <option value='radio'>"        . __( 'Select a single item from the list', 'invoicing' ) ."</option>
2466
-                        <option value='checkbox'>"     . __( 'Select one or more items on the list', 'invoicing' ) ."</option>
2467
-                        <option value='select'>"       . __( 'Select a single item from a dropdown', 'invoicing' ) ."</option>
2468
-                        <option value='multi_select'>" . __( 'Select a one or more items from a dropdown', 'invoicing' ) ."</option>
2464
+                        <option value='total'>" . __('Buy all items on the list', 'invoicing') . "</option>
2465
+                        <option value='radio'>"        . __('Select a single item from the list', 'invoicing') . "</option>
2466
+                        <option value='checkbox'>"     . __('Select one or more items on the list', 'invoicing') . "</option>
2467
+                        <option value='select'>"       . __('Select a single item from a dropdown', 'invoicing') . "</option>
2468
+                        <option value='multi_select'>" . __('Select a one or more items from a dropdown', 'invoicing') . "</option>
2469 2469
                     </select>
2470 2470
 
2471 2471
                 </div>
@@ -2490,27 +2490,27 @@  discard block
 block discarded – undo
2490 2490
             'orderby'        => 'title',
2491 2491
             'order'          => 'ASC',
2492 2492
             'posts_per_page' => -1,
2493
-            'post_status'    => array( 'publish' ),
2493
+            'post_status'    => array('publish'),
2494 2494
         );
2495 2495
     
2496
-        $items      = get_posts( apply_filters( 'wpinv_item_dropdown_query_args', $item_args ) );
2496
+        $items = get_posts(apply_filters('wpinv_item_dropdown_query_args', $item_args));
2497 2497
 
2498
-        if ( empty( $items ) ) {
2498
+        if (empty($items)) {
2499 2499
             return array();
2500 2500
         }
2501 2501
 
2502
-        $options    = array();
2503
-        foreach ( $items as $item ) {
2504
-            $title            = esc_html( $item->post_title );
2505
-            $title           .= wpinv_get_item_suffix( $item->ID, false );
2506
-            $id               = absint( $item->ID );
2507
-            $price            = wpinv_sanitize_amount( get_post_meta( $id, '_wpinv_price', true ) );
2508
-            $recurring        = (bool) get_post_meta( $id, '_wpinv_is_recurring', true );
2502
+        $options = array();
2503
+        foreach ($items as $item) {
2504
+            $title            = esc_html($item->post_title);
2505
+            $title           .= wpinv_get_item_suffix($item->ID, false);
2506
+            $id               = absint($item->ID);
2507
+            $price            = wpinv_sanitize_amount(get_post_meta($id, '_wpinv_price', true));
2508
+            $recurring        = (bool) get_post_meta($id, '_wpinv_is_recurring', true);
2509 2509
             $description      = $item->post_excerpt;
2510
-            $custom_price     = (bool) get_post_meta( $id, '_wpinv_dynamic_pricing', true );
2511
-            $minimum_price    = (float) get_post_meta( $id, '_minimum_price', true );
2510
+            $custom_price     = (bool) get_post_meta($id, '_wpinv_dynamic_pricing', true);
2511
+            $minimum_price    = (float) get_post_meta($id, '_minimum_price', true);
2512 2512
             $allow_quantities = false;
2513
-            $options[]        = compact( 'title', 'id', 'price', 'recurring', 'description', 'custom_price', 'minimum_price', 'allow_quantities' );
2513
+            $options[]        = compact('title', 'id', 'price', 'recurring', 'description', 'custom_price', 'minimum_price', 'allow_quantities');
2514 2514
 
2515 2515
         }
2516 2516
         return $options;
@@ -2520,38 +2520,38 @@  discard block
 block discarded – undo
2520 2520
     /**
2521 2521
      * Returns an array of items for the currently being edited form.
2522 2522
      */
2523
-    public function get_form_items( $id = false ) {
2523
+    public function get_form_items($id = false) {
2524 2524
         
2525
-        if ( empty( $id ) ) {
2526
-            return wpinv_get_data( 'sample-payment-form-items' );
2525
+        if (empty($id)) {
2526
+            return wpinv_get_data('sample-payment-form-items');
2527 2527
         }
2528 2528
         
2529
-        $form_elements = get_post_meta( $id, 'wpinv_form_items', true );
2529
+        $form_elements = get_post_meta($id, 'wpinv_form_items', true);
2530 2530
 
2531
-        if ( is_array( $form_elements ) ) {
2531
+        if (is_array($form_elements)) {
2532 2532
             return $form_elements;
2533 2533
         }
2534 2534
 
2535
-        return wpinv_get_data( 'sample-payment-form-items' );
2535
+        return wpinv_get_data('sample-payment-form-items');
2536 2536
 
2537 2537
     }
2538 2538
 
2539 2539
     /**
2540 2540
      * Returns an array of elements for the currently being edited form.
2541 2541
      */
2542
-    public function get_form_elements( $id = false ) {
2542
+    public function get_form_elements($id = false) {
2543 2543
 
2544
-        if ( empty( $id ) ) {
2545
-            return wpinv_get_data( 'sample-payment-form' );
2544
+        if (empty($id)) {
2545
+            return wpinv_get_data('sample-payment-form');
2546 2546
         }
2547 2547
         
2548
-        $form_elements = get_post_meta( $id, 'wpinv_form_elements', true );
2548
+        $form_elements = get_post_meta($id, 'wpinv_form_elements', true);
2549 2549
 
2550
-        if ( is_array( $form_elements ) ) {
2550
+        if (is_array($form_elements)) {
2551 2551
             return $form_elements;
2552 2552
         }
2553 2553
 
2554
-        return wpinv_get_data( 'sample-payment-form' );
2554
+        return wpinv_get_data('sample-payment-form');
2555 2555
     }
2556 2556
 
2557 2557
 }
Please login to merge, or discard this patch.