Passed
Push — master ( 256d53...35ff88 )
by Brian
10:46
created
templates/payment-forms/elements/discount.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,24 +8,24 @@  discard block
 block discarded – undo
8 8
  * @var GetPaid_Payment_Form $form The current payment form
9 9
  */
10 10
 
11
-defined( 'ABSPATH' ) || exit;
11
+defined('ABSPATH') || exit;
12 12
 
13
-if ( ! getpaid_has_published_discount() ) {
13
+if (!getpaid_has_published_discount()) {
14 14
     return;
15 15
 }
16 16
 
17
-$placeholder = esc_attr( $input_label );
18
-$label       = esc_html( $button_label );
17
+$placeholder = esc_attr($input_label);
18
+$label       = esc_html($button_label);
19 19
 
20
-if ( ! empty( $description ) ) {
20
+if (!empty($description)) {
21 21
     $description = "<small class='form-text text-muted'>$description</small>";
22 22
 } else {
23 23
     $description = '';
24 24
 }
25 25
 
26 26
 $discount_code = '';
27
-if ( ! empty( $form->invoice ) ) {
28
-    $discount_code = esc_attr( $form->invoice->get_discount_code() );
27
+if (!empty($form->invoice)) {
28
+    $discount_code = esc_attr($form->invoice->get_discount_code());
29 29
 }
30 30
 
31 31
 ?>
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             <input name="discount" placeholder="<?php echo $placeholder; ?>" value="<?php echo $discount_code; ?>" class="form-control mr-2 mb-2 getpaid-discount-field-input" style="flex: 1;" type="text">
37 37
             <a href="#" class="btn btn-secondary submit-button mb-2 getpaid-discount-button"><?php echo $label; ?></a>
38 38
         </div>
39
-        <?php echo wp_kses_post( $description ); ?>
39
+        <?php echo wp_kses_post($description); ?>
40 40
         <div class="getpaid-custom-payment-form-errors alert alert-danger d-none"></div>
41 41
     </div>
42 42
 </div>
Please login to merge, or discard this patch.
templates/payment-forms/elements/heading.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$tag  = isset( $element['level'] ) ? trim( $element['level'] ) : 'h3';
13
-$text = isset( $element['text'] ) ? wp_kses_post( trim( $element['text'] ) ) : '';
12
+$tag  = isset($element['level']) ? trim($element['level']) : 'h3';
13
+$text = isset($element['text']) ? wp_kses_post(trim($element['text'])) : '';
14 14
 
15
-if ( ! empty( $text ) ) {
15
+if (!empty($text)) {
16 16
     echo "<$tag>$text</$tag>";
17 17
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/paragraph.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$text = isset( $element['text'] ) ? wp_kses_post( trim( $element['text'] ) ) : '';
12
+$text = isset($element['text']) ? wp_kses_post(trim($element['text'])) : '';
13 13
 
14
-if ( ! empty( $text ) ) {
14
+if (!empty($text)) {
15 15
     echo "<p>$text</p>";
16 16
 }
Please login to merge, or discard this patch.
includes/payments/class-getpaid-payment-form.php 2 patches
Indentation   +580 added lines, -580 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if ( ! defined( 'ABSPATH' ) ) {
3
-	exit;
3
+    exit;
4 4
 }
5 5
 
6 6
 /**
@@ -10,55 +10,55 @@  discard block
 block discarded – undo
10 10
 class GetPaid_Payment_Form extends GetPaid_Data {
11 11
 
12 12
     /**
13
-	 * Which data store to load.
14
-	 *
15
-	 * @var string
16
-	 */
13
+     * Which data store to load.
14
+     *
15
+     * @var string
16
+     */
17 17
     protected $data_store_name = 'payment_form';
18 18
 
19 19
     /**
20
-	 * This is the name of this object type.
21
-	 *
22
-	 * @var string
23
-	 */
24
-	protected $object_type = 'payment_form';
20
+     * This is the name of this object type.
21
+     *
22
+     * @var string
23
+     */
24
+    protected $object_type = 'payment_form';
25 25
 
26 26
     /**
27
-	 * Form Data array. This is the core form data exposed in APIs.
28
-	 *
29
-	 * @since 1.0.19
30
-	 * @var array
31
-	 */
32
-	protected $data = array(
33
-		'status'               => 'draft',
34
-		'version'              => '',
35
-		'date_created'         => null,
27
+     * Form Data array. This is the core form data exposed in APIs.
28
+     *
29
+     * @since 1.0.19
30
+     * @var array
31
+     */
32
+    protected $data = array(
33
+        'status'               => 'draft',
34
+        'version'              => '',
35
+        'date_created'         => null,
36 36
         'date_modified'        => null,
37 37
         'name'                 => '',
38 38
         'author'               => 1,
39 39
         'elements'             => null,
40
-		'items'                => null,
41
-		'earned'               => 0,
42
-		'refunded'             => 0,
43
-		'cancelled'            => 0,
44
-		'failed'               => 0,
45
-	);
46
-
47
-    /**
48
-	 * Stores meta in cache for future reads.
49
-	 *
50
-	 * A group must be set to to enable caching.
51
-	 *
52
-	 * @var string
53
-	 */
54
-	protected $cache_group = 'getpaid_forms';
55
-
56
-	/**
57
-	 * Stores a reference to the invoice if the form is for an invoice..
58
-	 *
59
-	 * @var WPInv_Invoice
60
-	 */
61
-	public $invoice = 0;
40
+        'items'                => null,
41
+        'earned'               => 0,
42
+        'refunded'             => 0,
43
+        'cancelled'            => 0,
44
+        'failed'               => 0,
45
+    );
46
+
47
+    /**
48
+     * Stores meta in cache for future reads.
49
+     *
50
+     * A group must be set to to enable caching.
51
+     *
52
+     * @var string
53
+     */
54
+    protected $cache_group = 'getpaid_forms';
55
+
56
+    /**
57
+     * Stores a reference to the invoice if the form is for an invoice..
58
+     *
59
+     * @var WPInv_Invoice
60
+     */
61
+    public $invoice = 0;
62 62
 
63 63
     /**
64 64
      * Stores a reference to the original WP_Post object
@@ -68,35 +68,35 @@  discard block
 block discarded – undo
68 68
     protected $post = null;
69 69
 
70 70
     /**
71
-	 * Get the form if ID is passed, otherwise the form is new and empty.
72
-	 *
73
-	 * @param  int|object|GetPaid_Payment_Form|WP_Post $form Form to read.
74
-	 */
75
-	public function __construct( $form = 0 ) {
76
-		parent::__construct( $form );
71
+     * Get the form if ID is passed, otherwise the form is new and empty.
72
+     *
73
+     * @param  int|object|GetPaid_Payment_Form|WP_Post $form Form to read.
74
+     */
75
+    public function __construct( $form = 0 ) {
76
+        parent::__construct( $form );
77 77
 
78
-		if ( is_numeric( $form ) && $form > 0 ) {
79
-			$this->set_id( $form );
80
-		} elseif ( $form instanceof self ) {
78
+        if ( is_numeric( $form ) && $form > 0 ) {
79
+            $this->set_id( $form );
80
+        } elseif ( $form instanceof self ) {
81 81
 
82
-			$this->set_id( $form->get_id() );
83
-			$this->invoice = $form->invoice;
82
+            $this->set_id( $form->get_id() );
83
+            $this->invoice = $form->invoice;
84 84
 
85
-		} elseif ( ! empty( $form->ID ) ) {
86
-			$this->set_id( $form->ID );
87
-		} else {
88
-			$this->set_object_read( true );
89
-		}
85
+        } elseif ( ! empty( $form->ID ) ) {
86
+            $this->set_id( $form->ID );
87
+        } else {
88
+            $this->set_object_read( true );
89
+        }
90 90
 
91 91
         // Load the datastore.
92
-		$this->data_store = GetPaid_Data_Store::load( $this->data_store_name );
92
+        $this->data_store = GetPaid_Data_Store::load( $this->data_store_name );
93 93
 
94
-		if ( $this->get_id() > 0 ) {
94
+        if ( $this->get_id() > 0 ) {
95 95
             $this->post = get_post( $this->get_id() );
96
-			$this->data_store->read( $this );
96
+            $this->data_store->read( $this );
97 97
         }
98 98
 
99
-	}
99
+    }
100 100
 
101 101
     /*
102 102
 	|--------------------------------------------------------------------------
@@ -114,358 +114,358 @@  discard block
 block discarded – undo
114 114
     */
115 115
 
116 116
     /**
117
-	 * Get plugin version when the form was created.
118
-	 *
119
-	 * @since 1.0.19
120
-	 * @param  string $context View or edit context.
121
-	 * @return string
122
-	 */
123
-	public function get_version( $context = 'view' ) {
124
-		return $this->get_prop( 'version', $context );
117
+     * Get plugin version when the form was created.
118
+     *
119
+     * @since 1.0.19
120
+     * @param  string $context View or edit context.
121
+     * @return string
122
+     */
123
+    public function get_version( $context = 'view' ) {
124
+        return $this->get_prop( 'version', $context );
125 125
     }
126 126
 
127 127
     /**
128
-	 * Get date when the form was created.
129
-	 *
130
-	 * @since 1.0.19
131
-	 * @param  string $context View or edit context.
132
-	 * @return string
133
-	 */
134
-	public function get_date_created( $context = 'view' ) {
135
-		return $this->get_prop( 'date_created', $context );
128
+     * Get date when the form was created.
129
+     *
130
+     * @since 1.0.19
131
+     * @param  string $context View or edit context.
132
+     * @return string
133
+     */
134
+    public function get_date_created( $context = 'view' ) {
135
+        return $this->get_prop( 'date_created', $context );
136 136
     }
137 137
 
138 138
     /**
139
-	 * Get GMT date when the form was created.
140
-	 *
141
-	 * @since 1.0.19
142
-	 * @param  string $context View or edit context.
143
-	 * @return string
144
-	 */
145
-	public function get_date_created_gmt( $context = 'view' ) {
139
+     * Get GMT date when the form was created.
140
+     *
141
+     * @since 1.0.19
142
+     * @param  string $context View or edit context.
143
+     * @return string
144
+     */
145
+    public function get_date_created_gmt( $context = 'view' ) {
146 146
         $date = $this->get_date_created( $context );
147 147
 
148 148
         if ( $date ) {
149 149
             $date = get_gmt_from_date( $date );
150 150
         }
151
-		return $date;
151
+        return $date;
152 152
     }
153 153
 
154 154
     /**
155
-	 * Get date when the form was last modified.
156
-	 *
157
-	 * @since 1.0.19
158
-	 * @param  string $context View or edit context.
159
-	 * @return string
160
-	 */
161
-	public function get_date_modified( $context = 'view' ) {
162
-		return $this->get_prop( 'date_modified', $context );
155
+     * Get date when the form was last modified.
156
+     *
157
+     * @since 1.0.19
158
+     * @param  string $context View or edit context.
159
+     * @return string
160
+     */
161
+    public function get_date_modified( $context = 'view' ) {
162
+        return $this->get_prop( 'date_modified', $context );
163 163
     }
164 164
 
165 165
     /**
166
-	 * Get GMT date when the form was last modified.
167
-	 *
168
-	 * @since 1.0.19
169
-	 * @param  string $context View or edit context.
170
-	 * @return string
171
-	 */
172
-	public function get_date_modified_gmt( $context = 'view' ) {
166
+     * Get GMT date when the form was last modified.
167
+     *
168
+     * @since 1.0.19
169
+     * @param  string $context View or edit context.
170
+     * @return string
171
+     */
172
+    public function get_date_modified_gmt( $context = 'view' ) {
173 173
         $date = $this->get_date_modified( $context );
174 174
 
175 175
         if ( $date ) {
176 176
             $date = get_gmt_from_date( $date );
177 177
         }
178
-		return $date;
178
+        return $date;
179 179
     }
180 180
 
181 181
     /**
182
-	 * Get the form name.
183
-	 *
184
-	 * @since 1.0.19
185
-	 * @param  string $context View or edit context.
186
-	 * @return string
187
-	 */
188
-	public function get_name( $context = 'view' ) {
189
-		return $this->get_prop( 'name', $context );
182
+     * Get the form name.
183
+     *
184
+     * @since 1.0.19
185
+     * @param  string $context View or edit context.
186
+     * @return string
187
+     */
188
+    public function get_name( $context = 'view' ) {
189
+        return $this->get_prop( 'name', $context );
190 190
     }
191 191
 
192 192
     /**
193
-	 * Alias of self::get_name().
194
-	 *
195
-	 * @since 1.0.19
196
-	 * @param  string $context View or edit context.
197
-	 * @return string
198
-	 */
199
-	public function get_title( $context = 'view' ) {
200
-		return $this->get_name( $context );
201
-	}
193
+     * Alias of self::get_name().
194
+     *
195
+     * @since 1.0.19
196
+     * @param  string $context View or edit context.
197
+     * @return string
198
+     */
199
+    public function get_title( $context = 'view' ) {
200
+        return $this->get_name( $context );
201
+    }
202 202
 
203 203
     /**
204
-	 * Get the owner of the form.
205
-	 *
206
-	 * @since 1.0.19
207
-	 * @param  string $context View or edit context.
208
-	 * @return int
209
-	 */
210
-	public function get_author( $context = 'view' ) {
211
-		return (int) $this->get_prop( 'author', $context );
204
+     * Get the owner of the form.
205
+     *
206
+     * @since 1.0.19
207
+     * @param  string $context View or edit context.
208
+     * @return int
209
+     */
210
+    public function get_author( $context = 'view' ) {
211
+        return (int) $this->get_prop( 'author', $context );
212 212
     }
213 213
 
214 214
     /**
215
-	 * Get the elements that make up the form.
216
-	 *
217
-	 * @since 1.0.19
218
-	 * @param  string $context View or edit context.
219
-	 * @return array
220
-	 */
221
-	public function get_elements( $context = 'view' ) {
222
-		$elements = $this->get_prop( 'elements', $context );
215
+     * Get the elements that make up the form.
216
+     *
217
+     * @since 1.0.19
218
+     * @param  string $context View or edit context.
219
+     * @return array
220
+     */
221
+    public function get_elements( $context = 'view' ) {
222
+        $elements = $this->get_prop( 'elements', $context );
223 223
 
224
-		if ( empty( $elements ) || ! is_array( $elements ) ) {
224
+        if ( empty( $elements ) || ! is_array( $elements ) ) {
225 225
             return wpinv_get_data( 'sample-payment-form' );
226
-		}
226
+        }
227 227
 
228
-		// Ensure that all required elements exist.
229
-		$_elements = array();
230
-		foreach ( $elements as $element ) {
228
+        // Ensure that all required elements exist.
229
+        $_elements = array();
230
+        foreach ( $elements as $element ) {
231 231
 
232
-			if ( $element['type'] == 'pay_button' && ! $this->has_element_type( 'gateway_select' ) ) {
232
+            if ( $element['type'] == 'pay_button' && ! $this->has_element_type( 'gateway_select' ) ) {
233 233
 
234
-				$_elements[] = array(
235
-					'text'        => __( 'Select Payment Method', 'invoicing' ),
236
-					'id'          => 'gtscicd',
237
-					'name'        => 'gtscicd',
238
-					'type'        => 'gateway_select',
239
-					'premade'     => true
234
+                $_elements[] = array(
235
+                    'text'        => __( 'Select Payment Method', 'invoicing' ),
236
+                    'id'          => 'gtscicd',
237
+                    'name'        => 'gtscicd',
238
+                    'type'        => 'gateway_select',
239
+                    'premade'     => true
240 240
 			
241
-				);
241
+                );
242 242
 
243
-			}
243
+            }
244 244
 
245
-			$_elements[] = $element;
245
+            $_elements[] = $element;
246 246
 
247
-		}
247
+        }
248 248
 
249 249
         return $_elements;
250
-	}
251
-
252
-	/**
253
-	 * Get the items sold via the form.
254
-	 *
255
-	 * @since 1.0.19
256
-	 * @param  string $context View or edit context.
257
-	 * @param  string $return objects or arrays.
258
-	 * @return GetPaid_Form_Item[]
259
-	 */
260
-	public function get_items( $context = 'view', $return = 'objects' ) {
261
-		$items = $this->get_prop( 'items', $context );
262
-
263
-		if ( empty( $items ) || ! is_array( $items ) ) {
250
+    }
251
+
252
+    /**
253
+     * Get the items sold via the form.
254
+     *
255
+     * @since 1.0.19
256
+     * @param  string $context View or edit context.
257
+     * @param  string $return objects or arrays.
258
+     * @return GetPaid_Form_Item[]
259
+     */
260
+    public function get_items( $context = 'view', $return = 'objects' ) {
261
+        $items = $this->get_prop( 'items', $context );
262
+
263
+        if ( empty( $items ) || ! is_array( $items ) ) {
264 264
             $items = wpinv_get_data( 'sample-payment-form-items' );
265
-		}
265
+        }
266 266
 
267
-		// Convert the items.
268
-		$prepared = array();
267
+        // Convert the items.
268
+        $prepared = array();
269 269
 
270
-		foreach ( $items as $key => $value ) {
270
+        foreach ( $items as $key => $value ) {
271 271
 
272
-			// Form items.
273
-			if ( $value instanceof GetPaid_Form_Item ) {
272
+            // Form items.
273
+            if ( $value instanceof GetPaid_Form_Item ) {
274 274
 
275
-				if ( $value->can_purchase() ) {
276
-					$prepared[] = $value;
277
-				}
275
+                if ( $value->can_purchase() ) {
276
+                    $prepared[] = $value;
277
+                }
278 278
 
279
-				continue;
279
+                continue;
280 280
 
281
-			}
281
+            }
282 282
 
283
-			// $item_id => $quantity (buy buttons)
284
-			if ( is_numeric( $key ) && is_numeric( $value ) ) {
285
-				$item = new GetPaid_Form_Item( $key );
283
+            // $item_id => $quantity (buy buttons)
284
+            if ( is_numeric( $key ) && is_numeric( $value ) ) {
285
+                $item = new GetPaid_Form_Item( $key );
286 286
 
287
-				if ( $item->can_purchase() ) {
287
+                if ( $item->can_purchase() ) {
288 288
 
289
-					$value = (float) $value;
290
-					$item->set_quantity( $value );
291
-					if ( 0 == $value ) {
292
-						$item->set_quantity( 1 );
293
-						$item->set_allow_quantities( true );
294
-					}
289
+                    $value = (float) $value;
290
+                    $item->set_quantity( $value );
291
+                    if ( 0 == $value ) {
292
+                        $item->set_quantity( 1 );
293
+                        $item->set_allow_quantities( true );
294
+                    }
295 295
 
296
-					$prepared[] = $item;
297
-				}
296
+                    $prepared[] = $item;
297
+                }
298 298
 
299
-				continue;
300
-			}
299
+                continue;
300
+            }
301 301
 
302
-			// Items saved via payment forms editor.
303
-			if ( is_array( $value ) && isset( $value['id'] ) ) {
302
+            // Items saved via payment forms editor.
303
+            if ( is_array( $value ) && isset( $value['id'] ) ) {
304 304
 
305
-				$item = new GetPaid_Form_Item( $value['id'] );
305
+                $item = new GetPaid_Form_Item( $value['id'] );
306 306
 
307
-				if ( ! $item->can_purchase() ) {
308
-					continue;
309
-				}
307
+                if ( ! $item->can_purchase() ) {
308
+                    continue;
309
+                }
310 310
 
311
-				// Sub-total (Cart items).
312
-				if ( isset( $value['subtotal'] ) ) {
313
-					$item->set_price( $value['subtotal'] );
314
-				}
311
+                // Sub-total (Cart items).
312
+                if ( isset( $value['subtotal'] ) ) {
313
+                    $item->set_price( $value['subtotal'] );
314
+                }
315 315
 
316
-				if ( isset( $value['quantity'] ) ) {
317
-					$item->set_quantity( $value['quantity'] );
318
-				}
316
+                if ( isset( $value['quantity'] ) ) {
317
+                    $item->set_quantity( $value['quantity'] );
318
+                }
319 319
 
320
-				if ( isset( $value['allow_quantities'] ) ) {
321
-					$item->set_allow_quantities( $value['allow_quantities'] );
322
-				}
320
+                if ( isset( $value['allow_quantities'] ) ) {
321
+                    $item->set_allow_quantities( $value['allow_quantities'] );
322
+                }
323 323
 
324
-				if ( isset( $value['required'] ) ) {
325
-					$item->set_is_required( $value['required'] );
326
-				}
324
+                if ( isset( $value['required'] ) ) {
325
+                    $item->set_is_required( $value['required'] );
326
+                }
327 327
 
328
-				if ( isset( $value['description'] ) ) {
329
-					$item->set_custom_description( $value['description'] );
330
-				}
328
+                if ( isset( $value['description'] ) ) {
329
+                    $item->set_custom_description( $value['description'] );
330
+                }
331 331
 
332
-				$prepared[] = $item;
333
-				continue;
332
+                $prepared[] = $item;
333
+                continue;
334 334
 
335
-			}
335
+            }
336 336
 
337
-			// $item_id => array( 'price' => 10 ) (item variations)
338
-			if ( is_numeric( $key ) && is_array( $value ) ) {
339
-				$item = new GetPaid_Form_Item( $key );
337
+            // $item_id => array( 'price' => 10 ) (item variations)
338
+            if ( is_numeric( $key ) && is_array( $value ) ) {
339
+                $item = new GetPaid_Form_Item( $key );
340 340
 
341
-				if ( isset( $value['price'] ) && $item->user_can_set_their_price() ) {
342
-					$item->set_price( $value['price'] );
343
-				}
344
-
345
-				if ( $item->can_purchase() ) {
346
-					$prepared[] = $item;
347
-				}
348
-
349
-				continue;
350
-			}
351
-
352
-		}
353
-
354
-		if ( 'objects' == $return && 'view' == $context ) {
355
-			return $prepared;
356
-		}
357
-
358
-		$items = array();
359
-		foreach ( $prepared as $item ) {
360
-			$items[] = $item->prepare_data_for_use();
361
-		}
362
-
363
-		return $items;
364
-	}
365
-
366
-	/**
367
-	 * Get a single item belonging to the form.
368
-	 *
369
-	 * @since 1.0.19
370
-	 * @param  int $item_id The item id to return.
371
-	 * @return GetPaid_Form_Item|bool
372
-	 */
373
-	public function get_item( $item_id ) {
374
-
375
-		if ( empty( $item_id ) || ! is_numeric( $item_id ) ) {
376
-			return false;
377
-		}
378
-
379
-		foreach( $this->get_items() as $item ) {
380
-			if ( $item->get_id() == (int) $item_id ) {
381
-				return $item;
382
-			}
383
-		}
384
-
385
-		return false;
386
-
387
-	}
388
-
389
-	/**
390
-	 * Gets a single element.
391
-	 *
392
-	 * @since 1.0.19
393
-	 * @param  string $element_type The element type to return.
394
-	 * @return array|bool
395
-	 */
396
-	public function get_element_type( $element_type ) {
397
-
398
-		if ( empty( $element_type ) || ! is_scalar( $element_type ) ) {
399
-			return false;
400
-		}
401
-
402
-		foreach ( $this->get_prop( 'elements' ) as $element ) {
403
-
404
-			if ( $element['type'] == $element_type ) {
405
-				return $element;
406
-			}
407
-
408
-		}
409
-
410
-		return false;
411
-
412
-	}
413
-
414
-	/**
415
-	 * Get the total amount earned via this form.
416
-	 *
417
-	 * @since 1.0.19
418
-	 * @param  string $context View or edit context.
419
-	 * @return float
420
-	 */
421
-	public function get_earned( $context = 'view' ) {
422
-		return $this->get_prop( 'earned', $context );
423
-	}
424
-
425
-	/**
426
-	 * Get the total amount refunded via this form.
427
-	 *
428
-	 * @since 1.0.19
429
-	 * @param  string $context View or edit context.
430
-	 * @return float
431
-	 */
432
-	public function get_refunded( $context = 'view' ) {
433
-		return $this->get_prop( 'refunded', $context );
434
-	}
435
-
436
-	/**
437
-	 * Get the total amount cancelled via this form.
438
-	 *
439
-	 * @since 1.0.19
440
-	 * @param  string $context View or edit context.
441
-	 * @return float
442
-	 */
443
-	public function get_cancelled( $context = 'view' ) {
444
-		return $this->get_prop( 'cancelled', $context );
445
-	}
446
-
447
-	/**
448
-	 * Get the total amount failed via this form.
449
-	 *
450
-	 * @since 1.0.19
451
-	 * @param  string $context View or edit context.
452
-	 * @return float
453
-	 */
454
-	public function get_failed( $context = 'view' ) {
455
-		return $this->get_prop( 'failed', $context );
456
-	}
457
-
458
-	/**
459
-	 * Get the currency.
460
-	 *
461
-	 * @since 1.0.19
462
-	 * @param  string $context View or edit context.
463
-	 * @return string
464
-	 */
465
-	public function get_currency() {
466
-		$currency = empty( $this->invoice ) ? wpinv_get_currency() : $this->invoice->get_currency();
467
-		return apply_filters( 'getpaid-payment-form-currency', $currency, $this );
468
-	}
341
+                if ( isset( $value['price'] ) && $item->user_can_set_their_price() ) {
342
+                    $item->set_price( $value['price'] );
343
+                }
344
+
345
+                if ( $item->can_purchase() ) {
346
+                    $prepared[] = $item;
347
+                }
348
+
349
+                continue;
350
+            }
351
+
352
+        }
353
+
354
+        if ( 'objects' == $return && 'view' == $context ) {
355
+            return $prepared;
356
+        }
357
+
358
+        $items = array();
359
+        foreach ( $prepared as $item ) {
360
+            $items[] = $item->prepare_data_for_use();
361
+        }
362
+
363
+        return $items;
364
+    }
365
+
366
+    /**
367
+     * Get a single item belonging to the form.
368
+     *
369
+     * @since 1.0.19
370
+     * @param  int $item_id The item id to return.
371
+     * @return GetPaid_Form_Item|bool
372
+     */
373
+    public function get_item( $item_id ) {
374
+
375
+        if ( empty( $item_id ) || ! is_numeric( $item_id ) ) {
376
+            return false;
377
+        }
378
+
379
+        foreach( $this->get_items() as $item ) {
380
+            if ( $item->get_id() == (int) $item_id ) {
381
+                return $item;
382
+            }
383
+        }
384
+
385
+        return false;
386
+
387
+    }
388
+
389
+    /**
390
+     * Gets a single element.
391
+     *
392
+     * @since 1.0.19
393
+     * @param  string $element_type The element type to return.
394
+     * @return array|bool
395
+     */
396
+    public function get_element_type( $element_type ) {
397
+
398
+        if ( empty( $element_type ) || ! is_scalar( $element_type ) ) {
399
+            return false;
400
+        }
401
+
402
+        foreach ( $this->get_prop( 'elements' ) as $element ) {
403
+
404
+            if ( $element['type'] == $element_type ) {
405
+                return $element;
406
+            }
407
+
408
+        }
409
+
410
+        return false;
411
+
412
+    }
413
+
414
+    /**
415
+     * Get the total amount earned via this form.
416
+     *
417
+     * @since 1.0.19
418
+     * @param  string $context View or edit context.
419
+     * @return float
420
+     */
421
+    public function get_earned( $context = 'view' ) {
422
+        return $this->get_prop( 'earned', $context );
423
+    }
424
+
425
+    /**
426
+     * Get the total amount refunded via this form.
427
+     *
428
+     * @since 1.0.19
429
+     * @param  string $context View or edit context.
430
+     * @return float
431
+     */
432
+    public function get_refunded( $context = 'view' ) {
433
+        return $this->get_prop( 'refunded', $context );
434
+    }
435
+
436
+    /**
437
+     * Get the total amount cancelled via this form.
438
+     *
439
+     * @since 1.0.19
440
+     * @param  string $context View or edit context.
441
+     * @return float
442
+     */
443
+    public function get_cancelled( $context = 'view' ) {
444
+        return $this->get_prop( 'cancelled', $context );
445
+    }
446
+
447
+    /**
448
+     * Get the total amount failed via this form.
449
+     *
450
+     * @since 1.0.19
451
+     * @param  string $context View or edit context.
452
+     * @return float
453
+     */
454
+    public function get_failed( $context = 'view' ) {
455
+        return $this->get_prop( 'failed', $context );
456
+    }
457
+
458
+    /**
459
+     * Get the currency.
460
+     *
461
+     * @since 1.0.19
462
+     * @param  string $context View or edit context.
463
+     * @return string
464
+     */
465
+    public function get_currency() {
466
+        $currency = empty( $this->invoice ) ? wpinv_get_currency() : $this->invoice->get_currency();
467
+        return apply_filters( 'getpaid-payment-form-currency', $currency, $this );
468
+    }
469 469
 
470 470
     /*
471 471
 	|--------------------------------------------------------------------------
@@ -478,22 +478,22 @@  discard block
 block discarded – undo
478 478
     */
479 479
 
480 480
     /**
481
-	 * Set plugin version when the item was created.
482
-	 *
483
-	 * @since 1.0.19
484
-	 */
485
-	public function set_version( $value ) {
486
-		$this->set_prop( 'version', $value );
481
+     * Set plugin version when the item was created.
482
+     *
483
+     * @since 1.0.19
484
+     */
485
+    public function set_version( $value ) {
486
+        $this->set_prop( 'version', $value );
487 487
     }
488 488
 
489 489
     /**
490
-	 * Set date when the item was created.
491
-	 *
492
-	 * @since 1.0.19
493
-	 * @param string $value Value to set.
490
+     * Set date when the item was created.
491
+     *
492
+     * @since 1.0.19
493
+     * @param string $value Value to set.
494 494
      * @return bool Whether or not the date was set.
495
-	 */
496
-	public function set_date_created( $value ) {
495
+     */
496
+    public function set_date_created( $value ) {
497 497
         $date = strtotime( $value );
498 498
 
499 499
         if ( $date ) {
@@ -506,13 +506,13 @@  discard block
 block discarded – undo
506 506
     }
507 507
 
508 508
     /**
509
-	 * Set date when the item was last modified.
510
-	 *
511
-	 * @since 1.0.19
512
-	 * @param string $value Value to set.
509
+     * Set date when the item was last modified.
510
+     *
511
+     * @since 1.0.19
512
+     * @param string $value Value to set.
513 513
      * @return bool Whether or not the date was set.
514
-	 */
515
-	public function set_date_modified( $value ) {
514
+     */
515
+    public function set_date_modified( $value ) {
516 516
         $date = strtotime( $value );
517 517
 
518 518
         if ( $date ) {
@@ -525,165 +525,165 @@  discard block
 block discarded – undo
525 525
     }
526 526
 
527 527
     /**
528
-	 * Set the item name.
529
-	 *
530
-	 * @since 1.0.19
531
-	 * @param  string $value New name.
532
-	 */
533
-	public function set_name( $value ) {
534
-		$this->set_prop( 'name', sanitize_text_field( $value ) );
535
-    }
536
-
537
-    /**
538
-	 * Alias of self::set_name().
539
-	 *
540
-	 * @since 1.0.19
541
-	 * @param  string $value New name.
542
-	 */
543
-	public function set_title( $value ) {
544
-		$this->set_name( $value );
545
-    }
546
-
547
-    /**
548
-	 * Set the owner of the item.
549
-	 *
550
-	 * @since 1.0.19
551
-	 * @param  int $value New author.
552
-	 */
553
-	public function set_author( $value ) {
554
-		$this->set_prop( 'author', (int) $value );
555
-	}
556
-
557
-	/**
558
-	 * Set the form elements.
559
-	 *
560
-	 * @since 1.0.19
561
-	 * @sinve 2.3.4 Array values sanitized.
562
-	 * @param  array $value Form elements.
563
-	 */
564
-	public function set_elements( $value ) {
565
-		if ( is_array( $value ) ) {
566
-			$this->set_prop( 'elements', wp_kses_post_deep( $value ) );
567
-		}
568
-	}
569
-
570
-	/**
571
-	 * Sanitize array values.
572
-	 *
573
-	 * @param $value
574
-	 *
575
-	 * @return mixed
576
-	 */
577
-	public function sanitize_array_values($value){
578
-
579
-		// sanitize
580
-		if(!empty($value )){
581
-
582
-			foreach($value as $key => $val_arr){
583
-
584
-				if(is_array($val_arr)){
585
-					// check if we have sub array items.
586
-					$sub_arr = array();
587
-					foreach($val_arr as $key2 => $val2){
588
-						if(is_array($val2)){
589
-							$sub_arr[$key2] = $this->sanitize_array_values($val2);
590
-							unset($val_arr[$key][$key2]);
591
-						}
592
-					}
593
-
594
-					// we allow some html in description so we sanitize it separately.
595
-					$help_text = !empty($val_arr['description']) ? wp_kses_post($val_arr['description']) : '';
596
-
597
-					// sanitize array elements
598
-					$value[$key] = array_map( 'sanitize_text_field', $val_arr );
599
-
600
-					// add back the description if set
601
-					if(isset($val_arr['description'])){ $value[$key]['description'] = $help_text;}
602
-
603
-					// add back sub array items after its been sanitized.
604
-					if ( ! empty( $sub_arr ) ) {
605
-						$value[$key] = array_merge($value[$key],$sub_arr);
606
-					}
607
-				}
608
-
609
-			}
610
-
611
-		}
612
-
613
-		return $value;
614
-	}
615
-
616
-	/**
617
-	 * Set the form items.
618
-	 *
619
-	 * @since 1.0.19
620
-	 * @param  array $value Form elements.
621
-	 */
622
-	public function set_items( $value ) {
623
-		if ( is_array( $value ) ) {
624
-			$this->set_prop( 'items', $value );
625
-		}
626
-	}
627
-
628
-	/**
629
-	 * Set the total amount earned via this form.
630
-	 *
631
-	 * @since 1.0.19
632
-	 * @param  float $value Amount earned.
633
-	 */
634
-	public function set_earned( $value ) {
635
-		$value = max( (float) $value, 0 );
636
-		$this->set_prop( 'earned', $value );
637
-	}
638
-
639
-	/**
640
-	 * Set the total amount refunded via this form.
641
-	 *
642
-	 * @since 1.0.19
643
-	 * @param  float $value Amount refunded.
644
-	 */
645
-	public function set_refunded( $value ) {
646
-		$value = max( (float) $value, 0 );
647
-		$this->set_prop( 'refunded', $value );
648
-	}
649
-
650
-	/**
651
-	 * Set the total amount cancelled via this form.
652
-	 *
653
-	 * @since 1.0.19
654
-	 * @param  float $value Amount cancelled.
655
-	 */
656
-	public function set_cancelled( $value ) {
657
-		$value = max( (float) $value, 0 );
658
-		$this->set_prop( 'cancelled', $value );
659
-	}
660
-
661
-	/**
662
-	 * Set the total amount failed via this form.
663
-	 *
664
-	 * @since 1.0.19
665
-	 * @param  float $value Amount cancelled.
666
-	 */
667
-	public function set_failed( $value ) {
668
-		$value = max( (float) $value, 0 );
669
-		$this->set_prop( 'failed', $value );
670
-	}
528
+     * Set the item name.
529
+     *
530
+     * @since 1.0.19
531
+     * @param  string $value New name.
532
+     */
533
+    public function set_name( $value ) {
534
+        $this->set_prop( 'name', sanitize_text_field( $value ) );
535
+    }
536
+
537
+    /**
538
+     * Alias of self::set_name().
539
+     *
540
+     * @since 1.0.19
541
+     * @param  string $value New name.
542
+     */
543
+    public function set_title( $value ) {
544
+        $this->set_name( $value );
545
+    }
546
+
547
+    /**
548
+     * Set the owner of the item.
549
+     *
550
+     * @since 1.0.19
551
+     * @param  int $value New author.
552
+     */
553
+    public function set_author( $value ) {
554
+        $this->set_prop( 'author', (int) $value );
555
+    }
556
+
557
+    /**
558
+     * Set the form elements.
559
+     *
560
+     * @since 1.0.19
561
+     * @sinve 2.3.4 Array values sanitized.
562
+     * @param  array $value Form elements.
563
+     */
564
+    public function set_elements( $value ) {
565
+        if ( is_array( $value ) ) {
566
+            $this->set_prop( 'elements', wp_kses_post_deep( $value ) );
567
+        }
568
+    }
569
+
570
+    /**
571
+     * Sanitize array values.
572
+     *
573
+     * @param $value
574
+     *
575
+     * @return mixed
576
+     */
577
+    public function sanitize_array_values($value){
578
+
579
+        // sanitize
580
+        if(!empty($value )){
581
+
582
+            foreach($value as $key => $val_arr){
583
+
584
+                if(is_array($val_arr)){
585
+                    // check if we have sub array items.
586
+                    $sub_arr = array();
587
+                    foreach($val_arr as $key2 => $val2){
588
+                        if(is_array($val2)){
589
+                            $sub_arr[$key2] = $this->sanitize_array_values($val2);
590
+                            unset($val_arr[$key][$key2]);
591
+                        }
592
+                    }
593
+
594
+                    // we allow some html in description so we sanitize it separately.
595
+                    $help_text = !empty($val_arr['description']) ? wp_kses_post($val_arr['description']) : '';
596
+
597
+                    // sanitize array elements
598
+                    $value[$key] = array_map( 'sanitize_text_field', $val_arr );
599
+
600
+                    // add back the description if set
601
+                    if(isset($val_arr['description'])){ $value[$key]['description'] = $help_text;}
602
+
603
+                    // add back sub array items after its been sanitized.
604
+                    if ( ! empty( $sub_arr ) ) {
605
+                        $value[$key] = array_merge($value[$key],$sub_arr);
606
+                    }
607
+                }
608
+
609
+            }
610
+
611
+        }
612
+
613
+        return $value;
614
+    }
615
+
616
+    /**
617
+     * Set the form items.
618
+     *
619
+     * @since 1.0.19
620
+     * @param  array $value Form elements.
621
+     */
622
+    public function set_items( $value ) {
623
+        if ( is_array( $value ) ) {
624
+            $this->set_prop( 'items', $value );
625
+        }
626
+    }
627
+
628
+    /**
629
+     * Set the total amount earned via this form.
630
+     *
631
+     * @since 1.0.19
632
+     * @param  float $value Amount earned.
633
+     */
634
+    public function set_earned( $value ) {
635
+        $value = max( (float) $value, 0 );
636
+        $this->set_prop( 'earned', $value );
637
+    }
638
+
639
+    /**
640
+     * Set the total amount refunded via this form.
641
+     *
642
+     * @since 1.0.19
643
+     * @param  float $value Amount refunded.
644
+     */
645
+    public function set_refunded( $value ) {
646
+        $value = max( (float) $value, 0 );
647
+        $this->set_prop( 'refunded', $value );
648
+    }
649
+
650
+    /**
651
+     * Set the total amount cancelled via this form.
652
+     *
653
+     * @since 1.0.19
654
+     * @param  float $value Amount cancelled.
655
+     */
656
+    public function set_cancelled( $value ) {
657
+        $value = max( (float) $value, 0 );
658
+        $this->set_prop( 'cancelled', $value );
659
+    }
660
+
661
+    /**
662
+     * Set the total amount failed via this form.
663
+     *
664
+     * @since 1.0.19
665
+     * @param  float $value Amount cancelled.
666
+     */
667
+    public function set_failed( $value ) {
668
+        $value = max( (float) $value, 0 );
669
+        $this->set_prop( 'failed', $value );
670
+    }
671 671
 
672 672
     /**
673 673
      * Create an item. For backwards compatibilty.
674 674
      *
675 675
      * @deprecated
676
-	 * @return int item id
676
+     * @return int item id
677 677
      */
678 678
     public function create( $data = array() ) {
679 679
 
680
-		// Set the properties.
681
-		if ( is_array( $data ) ) {
682
-			$this->set_props( $data );
683
-		}
680
+        // Set the properties.
681
+        if ( is_array( $data ) ) {
682
+            $this->set_props( $data );
683
+        }
684 684
 
685
-		// Save the item.
686
-		return $this->save();
685
+        // Save the item.
686
+        return $this->save();
687 687
 
688 688
     }
689 689
 
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
      * Updates an item. For backwards compatibilty.
692 692
      *
693 693
      * @deprecated
694
-	 * @return int item id
694
+     * @return int item id
695 695
      */
696 696
     public function update( $data = array() ) {
697 697
         return $this->create( $data );
@@ -707,22 +707,22 @@  discard block
 block discarded – undo
707 707
 	*/
708 708
 
709 709
     /**
710
-	 * Checks whether this is the default payment form.
711
-	 *
712
-	 * @since 1.0.19
713
-	 * @return bool
714
-	 */
710
+     * Checks whether this is the default payment form.
711
+     *
712
+     * @since 1.0.19
713
+     * @return bool
714
+     */
715 715
     public function is_default() {
716 716
         $is_default = $this->get_id() == wpinv_get_default_payment_form();
717 717
         return (bool) apply_filters( 'wpinv_is_default_payment_form', $is_default, $this->get_id(), $this );
718
-	}
718
+    }
719 719
 
720 720
     /**
721
-	 * Checks whether the form is active.
722
-	 *
723
-	 * @since 1.0.19
724
-	 * @return bool
725
-	 */
721
+     * Checks whether the form is active.
722
+     *
723
+     * @since 1.0.19
724
+     * @return bool
725
+     */
726 726
     public function is_active() {
727 727
         $is_active = 0 !== (int) $this->get_id();
728 728
 
@@ -731,76 +731,76 @@  discard block
 block discarded – undo
731 731
         }
732 732
 
733 733
         return (bool) apply_filters( 'wpinv_is_payment_form_active', $is_active, $this );
734
-	}
735
-
736
-	/**
737
-	 * Checks whether the form has a given item.
738
-	 *
739
-	 * @since 1.0.19
740
-	 * @return bool
741
-	 */
734
+    }
735
+
736
+    /**
737
+     * Checks whether the form has a given item.
738
+     *
739
+     * @since 1.0.19
740
+     * @return bool
741
+     */
742 742
     public function has_item( $item_id ) {
743 743
         return false !== $this->get_item( $item_id );
744
-	}
745
-
746
-	/**
747
-	 * Checks whether the form has a given element.
748
-	 *
749
-	 * @since 1.0.19
750
-	 * @return bool
751
-	 */
744
+    }
745
+
746
+    /**
747
+     * Checks whether the form has a given element.
748
+     *
749
+     * @since 1.0.19
750
+     * @return bool
751
+     */
752 752
     public function has_element_type( $element_type ) {
753 753
         return false !== $this->get_element_type( $element_type );
754
-	}
755
-
756
-	/**
757
-	 * Checks whether this form is recurring or not.
758
-	 *
759
-	 * @since 1.0.19
760
-	 * @return bool
761
-	 */
754
+    }
755
+
756
+    /**
757
+     * Checks whether this form is recurring or not.
758
+     *
759
+     * @since 1.0.19
760
+     * @return bool
761
+     */
762 762
     public function is_recurring() {
763 763
 
764
-		if ( ! empty( $this->invoice ) ) {
765
-			return $this->invoice->is_recurring();
766
-		}
764
+        if ( ! empty( $this->invoice ) ) {
765
+            return $this->invoice->is_recurring();
766
+        }
767 767
 
768
-		foreach ( $this->get_items() as $item ) {
768
+        foreach ( $this->get_items() as $item ) {
769 769
 
770
-			if ( $item->is_recurring() ) {
771
-				return true;
772
-			}
770
+            if ( $item->is_recurring() ) {
771
+                return true;
772
+            }
773 773
 
774
-		}
774
+        }
775 775
 
776 776
         return false;
777
-	}
777
+    }
778 778
 
779
-	/**
780
-	 * Retrieves the form's html.
781
-	 *
782
-	 * @since 1.0.19
783
-	 */
779
+    /**
780
+     * Retrieves the form's html.
781
+     *
782
+     * @since 1.0.19
783
+     */
784 784
     public function get_html( $extra_markup = '' ) {
785 785
 
786
-		// Return the HTML.
787
-		return wpinv_get_template_html(
788
-			'payment-forms/form.php',
789
-			array(
790
-				'form'         => $this,
791
-				'extra_markup' => $extra_markup,
792
-			)
793
-		);
794
-
795
-	}
796
-
797
-	/**
798
-	 * Displays the payment form.
799
-	 *
800
-	 * @since 1.0.19
801
-	 */
786
+        // Return the HTML.
787
+        return wpinv_get_template_html(
788
+            'payment-forms/form.php',
789
+            array(
790
+                'form'         => $this,
791
+                'extra_markup' => $extra_markup,
792
+            )
793
+        );
794
+
795
+    }
796
+
797
+    /**
798
+     * Displays the payment form.
799
+     *
800
+     * @since 1.0.19
801
+     */
802 802
     public function display( $extra_markup = '' ) {
803
-		echo $this->get_html( $extra_markup );
803
+        echo $this->get_html( $extra_markup );
804 804
     }
805 805
 
806 806
 }
Please login to merge, or discard this patch.
Spacing   +155 added lines, -155 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'ABSPATH' ) ) {
2
+if (!defined('ABSPATH')) {
3 3
 	exit;
4 4
 }
5 5
 
@@ -72,28 +72,28 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param  int|object|GetPaid_Payment_Form|WP_Post $form Form to read.
74 74
 	 */
75
-	public function __construct( $form = 0 ) {
76
-		parent::__construct( $form );
75
+	public function __construct($form = 0) {
76
+		parent::__construct($form);
77 77
 
78
-		if ( is_numeric( $form ) && $form > 0 ) {
79
-			$this->set_id( $form );
80
-		} elseif ( $form instanceof self ) {
78
+		if (is_numeric($form) && $form > 0) {
79
+			$this->set_id($form);
80
+		} elseif ($form instanceof self) {
81 81
 
82
-			$this->set_id( $form->get_id() );
82
+			$this->set_id($form->get_id());
83 83
 			$this->invoice = $form->invoice;
84 84
 
85
-		} elseif ( ! empty( $form->ID ) ) {
86
-			$this->set_id( $form->ID );
85
+		} elseif (!empty($form->ID)) {
86
+			$this->set_id($form->ID);
87 87
 		} else {
88
-			$this->set_object_read( true );
88
+			$this->set_object_read(true);
89 89
 		}
90 90
 
91 91
         // Load the datastore.
92
-		$this->data_store = GetPaid_Data_Store::load( $this->data_store_name );
92
+		$this->data_store = GetPaid_Data_Store::load($this->data_store_name);
93 93
 
94
-		if ( $this->get_id() > 0 ) {
95
-            $this->post = get_post( $this->get_id() );
96
-			$this->data_store->read( $this );
94
+		if ($this->get_id() > 0) {
95
+            $this->post = get_post($this->get_id());
96
+			$this->data_store->read($this);
97 97
         }
98 98
 
99 99
 	}
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 	 * @param  string $context View or edit context.
121 121
 	 * @return string
122 122
 	 */
123
-	public function get_version( $context = 'view' ) {
124
-		return $this->get_prop( 'version', $context );
123
+	public function get_version($context = 'view') {
124
+		return $this->get_prop('version', $context);
125 125
     }
126 126
 
127 127
     /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 	 * @param  string $context View or edit context.
132 132
 	 * @return string
133 133
 	 */
134
-	public function get_date_created( $context = 'view' ) {
135
-		return $this->get_prop( 'date_created', $context );
134
+	public function get_date_created($context = 'view') {
135
+		return $this->get_prop('date_created', $context);
136 136
     }
137 137
 
138 138
     /**
@@ -142,11 +142,11 @@  discard block
 block discarded – undo
142 142
 	 * @param  string $context View or edit context.
143 143
 	 * @return string
144 144
 	 */
145
-	public function get_date_created_gmt( $context = 'view' ) {
146
-        $date = $this->get_date_created( $context );
145
+	public function get_date_created_gmt($context = 'view') {
146
+        $date = $this->get_date_created($context);
147 147
 
148
-        if ( $date ) {
149
-            $date = get_gmt_from_date( $date );
148
+        if ($date) {
149
+            $date = get_gmt_from_date($date);
150 150
         }
151 151
 		return $date;
152 152
     }
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	 * @param  string $context View or edit context.
159 159
 	 * @return string
160 160
 	 */
161
-	public function get_date_modified( $context = 'view' ) {
162
-		return $this->get_prop( 'date_modified', $context );
161
+	public function get_date_modified($context = 'view') {
162
+		return $this->get_prop('date_modified', $context);
163 163
     }
164 164
 
165 165
     /**
@@ -169,11 +169,11 @@  discard block
 block discarded – undo
169 169
 	 * @param  string $context View or edit context.
170 170
 	 * @return string
171 171
 	 */
172
-	public function get_date_modified_gmt( $context = 'view' ) {
173
-        $date = $this->get_date_modified( $context );
172
+	public function get_date_modified_gmt($context = 'view') {
173
+        $date = $this->get_date_modified($context);
174 174
 
175
-        if ( $date ) {
176
-            $date = get_gmt_from_date( $date );
175
+        if ($date) {
176
+            $date = get_gmt_from_date($date);
177 177
         }
178 178
 		return $date;
179 179
     }
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 	 * @param  string $context View or edit context.
186 186
 	 * @return string
187 187
 	 */
188
-	public function get_name( $context = 'view' ) {
189
-		return $this->get_prop( 'name', $context );
188
+	public function get_name($context = 'view') {
189
+		return $this->get_prop('name', $context);
190 190
     }
191 191
 
192 192
     /**
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 	 * @param  string $context View or edit context.
197 197
 	 * @return string
198 198
 	 */
199
-	public function get_title( $context = 'view' ) {
200
-		return $this->get_name( $context );
199
+	public function get_title($context = 'view') {
200
+		return $this->get_name($context);
201 201
 	}
202 202
 
203 203
     /**
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
 	 * @param  string $context View or edit context.
208 208
 	 * @return int
209 209
 	 */
210
-	public function get_author( $context = 'view' ) {
211
-		return (int) $this->get_prop( 'author', $context );
210
+	public function get_author($context = 'view') {
211
+		return (int) $this->get_prop('author', $context);
212 212
     }
213 213
 
214 214
     /**
@@ -218,21 +218,21 @@  discard block
 block discarded – undo
218 218
 	 * @param  string $context View or edit context.
219 219
 	 * @return array
220 220
 	 */
221
-	public function get_elements( $context = 'view' ) {
222
-		$elements = $this->get_prop( 'elements', $context );
221
+	public function get_elements($context = 'view') {
222
+		$elements = $this->get_prop('elements', $context);
223 223
 
224
-		if ( empty( $elements ) || ! is_array( $elements ) ) {
225
-            return wpinv_get_data( 'sample-payment-form' );
224
+		if (empty($elements) || !is_array($elements)) {
225
+            return wpinv_get_data('sample-payment-form');
226 226
 		}
227 227
 
228 228
 		// Ensure that all required elements exist.
229 229
 		$_elements = array();
230
-		foreach ( $elements as $element ) {
230
+		foreach ($elements as $element) {
231 231
 
232
-			if ( $element['type'] == 'pay_button' && ! $this->has_element_type( 'gateway_select' ) ) {
232
+			if ($element['type'] == 'pay_button' && !$this->has_element_type('gateway_select')) {
233 233
 
234 234
 				$_elements[] = array(
235
-					'text'        => __( 'Select Payment Method', 'invoicing' ),
235
+					'text'        => __('Select Payment Method', 'invoicing'),
236 236
 					'id'          => 'gtscicd',
237 237
 					'name'        => 'gtscicd',
238 238
 					'type'        => 'gateway_select',
@@ -257,22 +257,22 @@  discard block
 block discarded – undo
257 257
 	 * @param  string $return objects or arrays.
258 258
 	 * @return GetPaid_Form_Item[]
259 259
 	 */
260
-	public function get_items( $context = 'view', $return = 'objects' ) {
261
-		$items = $this->get_prop( 'items', $context );
260
+	public function get_items($context = 'view', $return = 'objects') {
261
+		$items = $this->get_prop('items', $context);
262 262
 
263
-		if ( empty( $items ) || ! is_array( $items ) ) {
264
-            $items = wpinv_get_data( 'sample-payment-form-items' );
263
+		if (empty($items) || !is_array($items)) {
264
+            $items = wpinv_get_data('sample-payment-form-items');
265 265
 		}
266 266
 
267 267
 		// Convert the items.
268 268
 		$prepared = array();
269 269
 
270
-		foreach ( $items as $key => $value ) {
270
+		foreach ($items as $key => $value) {
271 271
 
272 272
 			// Form items.
273
-			if ( $value instanceof GetPaid_Form_Item ) {
273
+			if ($value instanceof GetPaid_Form_Item) {
274 274
 
275
-				if ( $value->can_purchase() ) {
275
+				if ($value->can_purchase()) {
276 276
 					$prepared[] = $value;
277 277
 				}
278 278
 
@@ -281,16 +281,16 @@  discard block
 block discarded – undo
281 281
 			}
282 282
 
283 283
 			// $item_id => $quantity (buy buttons)
284
-			if ( is_numeric( $key ) && is_numeric( $value ) ) {
285
-				$item = new GetPaid_Form_Item( $key );
284
+			if (is_numeric($key) && is_numeric($value)) {
285
+				$item = new GetPaid_Form_Item($key);
286 286
 
287
-				if ( $item->can_purchase() ) {
287
+				if ($item->can_purchase()) {
288 288
 
289 289
 					$value = (float) $value;
290
-					$item->set_quantity( $value );
291
-					if ( 0 == $value ) {
292
-						$item->set_quantity( 1 );
293
-						$item->set_allow_quantities( true );
290
+					$item->set_quantity($value);
291
+					if (0 == $value) {
292
+						$item->set_quantity(1);
293
+						$item->set_allow_quantities(true);
294 294
 					}
295 295
 
296 296
 					$prepared[] = $item;
@@ -300,33 +300,33 @@  discard block
 block discarded – undo
300 300
 			}
301 301
 
302 302
 			// Items saved via payment forms editor.
303
-			if ( is_array( $value ) && isset( $value['id'] ) ) {
303
+			if (is_array($value) && isset($value['id'])) {
304 304
 
305
-				$item = new GetPaid_Form_Item( $value['id'] );
305
+				$item = new GetPaid_Form_Item($value['id']);
306 306
 
307
-				if ( ! $item->can_purchase() ) {
307
+				if (!$item->can_purchase()) {
308 308
 					continue;
309 309
 				}
310 310
 
311 311
 				// Sub-total (Cart items).
312
-				if ( isset( $value['subtotal'] ) ) {
313
-					$item->set_price( $value['subtotal'] );
312
+				if (isset($value['subtotal'])) {
313
+					$item->set_price($value['subtotal']);
314 314
 				}
315 315
 
316
-				if ( isset( $value['quantity'] ) ) {
317
-					$item->set_quantity( $value['quantity'] );
316
+				if (isset($value['quantity'])) {
317
+					$item->set_quantity($value['quantity']);
318 318
 				}
319 319
 
320
-				if ( isset( $value['allow_quantities'] ) ) {
321
-					$item->set_allow_quantities( $value['allow_quantities'] );
320
+				if (isset($value['allow_quantities'])) {
321
+					$item->set_allow_quantities($value['allow_quantities']);
322 322
 				}
323 323
 
324
-				if ( isset( $value['required'] ) ) {
325
-					$item->set_is_required( $value['required'] );
324
+				if (isset($value['required'])) {
325
+					$item->set_is_required($value['required']);
326 326
 				}
327 327
 
328
-				if ( isset( $value['description'] ) ) {
329
-					$item->set_custom_description( $value['description'] );
328
+				if (isset($value['description'])) {
329
+					$item->set_custom_description($value['description']);
330 330
 				}
331 331
 
332 332
 				$prepared[] = $item;
@@ -335,14 +335,14 @@  discard block
 block discarded – undo
335 335
 			}
336 336
 
337 337
 			// $item_id => array( 'price' => 10 ) (item variations)
338
-			if ( is_numeric( $key ) && is_array( $value ) ) {
339
-				$item = new GetPaid_Form_Item( $key );
338
+			if (is_numeric($key) && is_array($value)) {
339
+				$item = new GetPaid_Form_Item($key);
340 340
 
341
-				if ( isset( $value['price'] ) && $item->user_can_set_their_price() ) {
342
-					$item->set_price( $value['price'] );
341
+				if (isset($value['price']) && $item->user_can_set_their_price()) {
342
+					$item->set_price($value['price']);
343 343
 				}
344 344
 
345
-				if ( $item->can_purchase() ) {
345
+				if ($item->can_purchase()) {
346 346
 					$prepared[] = $item;
347 347
 				}
348 348
 
@@ -351,12 +351,12 @@  discard block
 block discarded – undo
351 351
 
352 352
 		}
353 353
 
354
-		if ( 'objects' == $return && 'view' == $context ) {
354
+		if ('objects' == $return && 'view' == $context) {
355 355
 			return $prepared;
356 356
 		}
357 357
 
358 358
 		$items = array();
359
-		foreach ( $prepared as $item ) {
359
+		foreach ($prepared as $item) {
360 360
 			$items[] = $item->prepare_data_for_use();
361 361
 		}
362 362
 
@@ -370,14 +370,14 @@  discard block
 block discarded – undo
370 370
 	 * @param  int $item_id The item id to return.
371 371
 	 * @return GetPaid_Form_Item|bool
372 372
 	 */
373
-	public function get_item( $item_id ) {
373
+	public function get_item($item_id) {
374 374
 
375
-		if ( empty( $item_id ) || ! is_numeric( $item_id ) ) {
375
+		if (empty($item_id) || !is_numeric($item_id)) {
376 376
 			return false;
377 377
 		}
378 378
 
379
-		foreach( $this->get_items() as $item ) {
380
-			if ( $item->get_id() == (int) $item_id ) {
379
+		foreach ($this->get_items() as $item) {
380
+			if ($item->get_id() == (int) $item_id) {
381 381
 				return $item;
382 382
 			}
383 383
 		}
@@ -393,15 +393,15 @@  discard block
 block discarded – undo
393 393
 	 * @param  string $element_type The element type to return.
394 394
 	 * @return array|bool
395 395
 	 */
396
-	public function get_element_type( $element_type ) {
396
+	public function get_element_type($element_type) {
397 397
 
398
-		if ( empty( $element_type ) || ! is_scalar( $element_type ) ) {
398
+		if (empty($element_type) || !is_scalar($element_type)) {
399 399
 			return false;
400 400
 		}
401 401
 
402
-		foreach ( $this->get_prop( 'elements' ) as $element ) {
402
+		foreach ($this->get_prop('elements') as $element) {
403 403
 
404
-			if ( $element['type'] == $element_type ) {
404
+			if ($element['type'] == $element_type) {
405 405
 				return $element;
406 406
 			}
407 407
 
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
 	 * @param  string $context View or edit context.
419 419
 	 * @return float
420 420
 	 */
421
-	public function get_earned( $context = 'view' ) {
422
-		return $this->get_prop( 'earned', $context );
421
+	public function get_earned($context = 'view') {
422
+		return $this->get_prop('earned', $context);
423 423
 	}
424 424
 
425 425
 	/**
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
 	 * @param  string $context View or edit context.
430 430
 	 * @return float
431 431
 	 */
432
-	public function get_refunded( $context = 'view' ) {
433
-		return $this->get_prop( 'refunded', $context );
432
+	public function get_refunded($context = 'view') {
433
+		return $this->get_prop('refunded', $context);
434 434
 	}
435 435
 
436 436
 	/**
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 	 * @param  string $context View or edit context.
441 441
 	 * @return float
442 442
 	 */
443
-	public function get_cancelled( $context = 'view' ) {
444
-		return $this->get_prop( 'cancelled', $context );
443
+	public function get_cancelled($context = 'view') {
444
+		return $this->get_prop('cancelled', $context);
445 445
 	}
446 446
 
447 447
 	/**
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
 	 * @param  string $context View or edit context.
452 452
 	 * @return float
453 453
 	 */
454
-	public function get_failed( $context = 'view' ) {
455
-		return $this->get_prop( 'failed', $context );
454
+	public function get_failed($context = 'view') {
455
+		return $this->get_prop('failed', $context);
456 456
 	}
457 457
 
458 458
 	/**
@@ -463,8 +463,8 @@  discard block
 block discarded – undo
463 463
 	 * @return string
464 464
 	 */
465 465
 	public function get_currency() {
466
-		$currency = empty( $this->invoice ) ? wpinv_get_currency() : $this->invoice->get_currency();
467
-		return apply_filters( 'getpaid-payment-form-currency', $currency, $this );
466
+		$currency = empty($this->invoice) ? wpinv_get_currency() : $this->invoice->get_currency();
467
+		return apply_filters('getpaid-payment-form-currency', $currency, $this);
468 468
 	}
469 469
 
470 470
     /*
@@ -482,8 +482,8 @@  discard block
 block discarded – undo
482 482
 	 *
483 483
 	 * @since 1.0.19
484 484
 	 */
485
-	public function set_version( $value ) {
486
-		$this->set_prop( 'version', $value );
485
+	public function set_version($value) {
486
+		$this->set_prop('version', $value);
487 487
     }
488 488
 
489 489
     /**
@@ -493,11 +493,11 @@  discard block
 block discarded – undo
493 493
 	 * @param string $value Value to set.
494 494
      * @return bool Whether or not the date was set.
495 495
 	 */
496
-	public function set_date_created( $value ) {
497
-        $date = strtotime( $value );
496
+	public function set_date_created($value) {
497
+        $date = strtotime($value);
498 498
 
499
-        if ( $date ) {
500
-            $this->set_prop( 'date_created', date( 'Y-m-d H:i:s', $date ) );
499
+        if ($date) {
500
+            $this->set_prop('date_created', date('Y-m-d H:i:s', $date));
501 501
             return true;
502 502
         }
503 503
 
@@ -512,11 +512,11 @@  discard block
 block discarded – undo
512 512
 	 * @param string $value Value to set.
513 513
      * @return bool Whether or not the date was set.
514 514
 	 */
515
-	public function set_date_modified( $value ) {
516
-        $date = strtotime( $value );
515
+	public function set_date_modified($value) {
516
+        $date = strtotime($value);
517 517
 
518
-        if ( $date ) {
519
-            $this->set_prop( 'date_modified', date( 'Y-m-d H:i:s', $date ) );
518
+        if ($date) {
519
+            $this->set_prop('date_modified', date('Y-m-d H:i:s', $date));
520 520
             return true;
521 521
         }
522 522
 
@@ -530,8 +530,8 @@  discard block
 block discarded – undo
530 530
 	 * @since 1.0.19
531 531
 	 * @param  string $value New name.
532 532
 	 */
533
-	public function set_name( $value ) {
534
-		$this->set_prop( 'name', sanitize_text_field( $value ) );
533
+	public function set_name($value) {
534
+		$this->set_prop('name', sanitize_text_field($value));
535 535
     }
536 536
 
537 537
     /**
@@ -540,8 +540,8 @@  discard block
 block discarded – undo
540 540
 	 * @since 1.0.19
541 541
 	 * @param  string $value New name.
542 542
 	 */
543
-	public function set_title( $value ) {
544
-		$this->set_name( $value );
543
+	public function set_title($value) {
544
+		$this->set_name($value);
545 545
     }
546 546
 
547 547
     /**
@@ -550,8 +550,8 @@  discard block
 block discarded – undo
550 550
 	 * @since 1.0.19
551 551
 	 * @param  int $value New author.
552 552
 	 */
553
-	public function set_author( $value ) {
554
-		$this->set_prop( 'author', (int) $value );
553
+	public function set_author($value) {
554
+		$this->set_prop('author', (int) $value);
555 555
 	}
556 556
 
557 557
 	/**
@@ -561,9 +561,9 @@  discard block
 block discarded – undo
561 561
 	 * @sinve 2.3.4 Array values sanitized.
562 562
 	 * @param  array $value Form elements.
563 563
 	 */
564
-	public function set_elements( $value ) {
565
-		if ( is_array( $value ) ) {
566
-			$this->set_prop( 'elements', wp_kses_post_deep( $value ) );
564
+	public function set_elements($value) {
565
+		if (is_array($value)) {
566
+			$this->set_prop('elements', wp_kses_post_deep($value));
567 567
 		}
568 568
 	}
569 569
 
@@ -574,18 +574,18 @@  discard block
 block discarded – undo
574 574
 	 *
575 575
 	 * @return mixed
576 576
 	 */
577
-	public function sanitize_array_values($value){
577
+	public function sanitize_array_values($value) {
578 578
 
579 579
 		// sanitize
580
-		if(!empty($value )){
580
+		if (!empty($value)) {
581 581
 
582
-			foreach($value as $key => $val_arr){
582
+			foreach ($value as $key => $val_arr) {
583 583
 
584
-				if(is_array($val_arr)){
584
+				if (is_array($val_arr)) {
585 585
 					// check if we have sub array items.
586 586
 					$sub_arr = array();
587
-					foreach($val_arr as $key2 => $val2){
588
-						if(is_array($val2)){
587
+					foreach ($val_arr as $key2 => $val2) {
588
+						if (is_array($val2)) {
589 589
 							$sub_arr[$key2] = $this->sanitize_array_values($val2);
590 590
 							unset($val_arr[$key][$key2]);
591 591
 						}
@@ -595,14 +595,14 @@  discard block
 block discarded – undo
595 595
 					$help_text = !empty($val_arr['description']) ? wp_kses_post($val_arr['description']) : '';
596 596
 
597 597
 					// sanitize array elements
598
-					$value[$key] = array_map( 'sanitize_text_field', $val_arr );
598
+					$value[$key] = array_map('sanitize_text_field', $val_arr);
599 599
 
600 600
 					// add back the description if set
601
-					if(isset($val_arr['description'])){ $value[$key]['description'] = $help_text;}
601
+					if (isset($val_arr['description'])) { $value[$key]['description'] = $help_text; }
602 602
 
603 603
 					// add back sub array items after its been sanitized.
604
-					if ( ! empty( $sub_arr ) ) {
605
-						$value[$key] = array_merge($value[$key],$sub_arr);
604
+					if (!empty($sub_arr)) {
605
+						$value[$key] = array_merge($value[$key], $sub_arr);
606 606
 					}
607 607
 				}
608 608
 
@@ -619,9 +619,9 @@  discard block
 block discarded – undo
619 619
 	 * @since 1.0.19
620 620
 	 * @param  array $value Form elements.
621 621
 	 */
622
-	public function set_items( $value ) {
623
-		if ( is_array( $value ) ) {
624
-			$this->set_prop( 'items', $value );
622
+	public function set_items($value) {
623
+		if (is_array($value)) {
624
+			$this->set_prop('items', $value);
625 625
 		}
626 626
 	}
627 627
 
@@ -631,9 +631,9 @@  discard block
 block discarded – undo
631 631
 	 * @since 1.0.19
632 632
 	 * @param  float $value Amount earned.
633 633
 	 */
634
-	public function set_earned( $value ) {
635
-		$value = max( (float) $value, 0 );
636
-		$this->set_prop( 'earned', $value );
634
+	public function set_earned($value) {
635
+		$value = max((float) $value, 0);
636
+		$this->set_prop('earned', $value);
637 637
 	}
638 638
 
639 639
 	/**
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
 	 * @since 1.0.19
643 643
 	 * @param  float $value Amount refunded.
644 644
 	 */
645
-	public function set_refunded( $value ) {
646
-		$value = max( (float) $value, 0 );
647
-		$this->set_prop( 'refunded', $value );
645
+	public function set_refunded($value) {
646
+		$value = max((float) $value, 0);
647
+		$this->set_prop('refunded', $value);
648 648
 	}
649 649
 
650 650
 	/**
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
 	 * @since 1.0.19
654 654
 	 * @param  float $value Amount cancelled.
655 655
 	 */
656
-	public function set_cancelled( $value ) {
657
-		$value = max( (float) $value, 0 );
658
-		$this->set_prop( 'cancelled', $value );
656
+	public function set_cancelled($value) {
657
+		$value = max((float) $value, 0);
658
+		$this->set_prop('cancelled', $value);
659 659
 	}
660 660
 
661 661
 	/**
@@ -664,9 +664,9 @@  discard block
 block discarded – undo
664 664
 	 * @since 1.0.19
665 665
 	 * @param  float $value Amount cancelled.
666 666
 	 */
667
-	public function set_failed( $value ) {
668
-		$value = max( (float) $value, 0 );
669
-		$this->set_prop( 'failed', $value );
667
+	public function set_failed($value) {
668
+		$value = max((float) $value, 0);
669
+		$this->set_prop('failed', $value);
670 670
 	}
671 671
 
672 672
     /**
@@ -675,11 +675,11 @@  discard block
 block discarded – undo
675 675
      * @deprecated
676 676
 	 * @return int item id
677 677
      */
678
-    public function create( $data = array() ) {
678
+    public function create($data = array()) {
679 679
 
680 680
 		// Set the properties.
681
-		if ( is_array( $data ) ) {
682
-			$this->set_props( $data );
681
+		if (is_array($data)) {
682
+			$this->set_props($data);
683 683
 		}
684 684
 
685 685
 		// Save the item.
@@ -693,8 +693,8 @@  discard block
 block discarded – undo
693 693
      * @deprecated
694 694
 	 * @return int item id
695 695
      */
696
-    public function update( $data = array() ) {
697
-        return $this->create( $data );
696
+    public function update($data = array()) {
697
+        return $this->create($data);
698 698
     }
699 699
 
700 700
     /*
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 	 */
715 715
     public function is_default() {
716 716
         $is_default = $this->get_id() == wpinv_get_default_payment_form();
717
-        return (bool) apply_filters( 'wpinv_is_default_payment_form', $is_default, $this->get_id(), $this );
717
+        return (bool) apply_filters('wpinv_is_default_payment_form', $is_default, $this->get_id(), $this);
718 718
 	}
719 719
 
720 720
     /**
@@ -726,11 +726,11 @@  discard block
 block discarded – undo
726 726
     public function is_active() {
727 727
         $is_active = 0 !== (int) $this->get_id();
728 728
 
729
-        if ( $is_active && ! current_user_can( 'edit_post', $this->get_id() ) && $this->get_status() != 'publish' ) {
729
+        if ($is_active && !current_user_can('edit_post', $this->get_id()) && $this->get_status() != 'publish') {
730 730
             $is_active = false;
731 731
         }
732 732
 
733
-        return (bool) apply_filters( 'wpinv_is_payment_form_active', $is_active, $this );
733
+        return (bool) apply_filters('wpinv_is_payment_form_active', $is_active, $this);
734 734
 	}
735 735
 
736 736
 	/**
@@ -739,8 +739,8 @@  discard block
 block discarded – undo
739 739
 	 * @since 1.0.19
740 740
 	 * @return bool
741 741
 	 */
742
-    public function has_item( $item_id ) {
743
-        return false !== $this->get_item( $item_id );
742
+    public function has_item($item_id) {
743
+        return false !== $this->get_item($item_id);
744 744
 	}
745 745
 
746 746
 	/**
@@ -749,8 +749,8 @@  discard block
 block discarded – undo
749 749
 	 * @since 1.0.19
750 750
 	 * @return bool
751 751
 	 */
752
-    public function has_element_type( $element_type ) {
753
-        return false !== $this->get_element_type( $element_type );
752
+    public function has_element_type($element_type) {
753
+        return false !== $this->get_element_type($element_type);
754 754
 	}
755 755
 
756 756
 	/**
@@ -761,13 +761,13 @@  discard block
 block discarded – undo
761 761
 	 */
762 762
     public function is_recurring() {
763 763
 
764
-		if ( ! empty( $this->invoice ) ) {
764
+		if (!empty($this->invoice)) {
765 765
 			return $this->invoice->is_recurring();
766 766
 		}
767 767
 
768
-		foreach ( $this->get_items() as $item ) {
768
+		foreach ($this->get_items() as $item) {
769 769
 
770
-			if ( $item->is_recurring() ) {
770
+			if ($item->is_recurring()) {
771 771
 				return true;
772 772
 			}
773 773
 
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 	 *
782 782
 	 * @since 1.0.19
783 783
 	 */
784
-    public function get_html( $extra_markup = '' ) {
784
+    public function get_html($extra_markup = '') {
785 785
 
786 786
 		// Return the HTML.
787 787
 		return wpinv_get_template_html(
@@ -799,8 +799,8 @@  discard block
 block discarded – undo
799 799
 	 *
800 800
 	 * @since 1.0.19
801 801
 	 */
802
-    public function display( $extra_markup = '' ) {
803
-		echo $this->get_html( $extra_markup );
802
+    public function display($extra_markup = '') {
803
+		echo $this->get_html($extra_markup);
804 804
     }
805 805
 
806 806
 }
Please login to merge, or discard this patch.