Passed
Push — master ( 0a2cdb...97ebee )
by Brian
04:41
created
templates/payment-forms/elements/discount.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,20 +8,20 @@  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
-if ( ! empty( $description ) ) {
17
+if (!empty($description)) {
18 18
     $description = "<small class='form-text text-muted'>$description</small>";
19 19
 } else {
20 20
     $description = '';
21 21
 }
22 22
 
23 23
 $discount_code = '';
24
-if ( ! empty( $form->invoice ) ) {
24
+if (!empty($form->invoice)) {
25 25
     $discount_code = $form->invoice->get_discount_code();
26 26
 }
27 27
 
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 <div class="form-group">
31 31
     <div class="getpaid-discount-field  border rounded p-3">
32 32
         <div class="getpaid-discount-field-inner d-flex flex-column flex-md-row">
33
-            <input name="discount" placeholder="<?php echo esc_attr( $input_label ); ?>" value="<?php echo esc_attr( $discount_code ); ?>" class="form-control mr-2 mb-2 getpaid-discount-field-input" style="flex: 1;" type="text">
34
-            <a href="#" class="btn btn-secondary submit-button mb-2 getpaid-discount-button"><?php echo esc_html( $button_label ); ?></a>
33
+            <input name="discount" placeholder="<?php echo esc_attr($input_label); ?>" value="<?php echo esc_attr($discount_code); ?>" class="form-control mr-2 mb-2 getpaid-discount-field-input" style="flex: 1;" type="text">
34
+            <a href="#" class="btn btn-secondary submit-button mb-2 getpaid-discount-button"><?php echo esc_html($button_label); ?></a>
35 35
         </div>
36
-        <?php echo wp_kses_post( $description ); ?>
36
+        <?php echo wp_kses_post($description); ?>
37 37
         <div class="getpaid-custom-payment-form-errors alert alert-danger d-none"></div>
38
-        <div class="getpaid-custom-payment-form-success alert alert-success d-none"><?php _e( 'Discount code applied!', 'invoicing' ); ?></div>
38
+        <div class="getpaid-custom-payment-form-success alert alert-success d-none"><?php _e('Discount code applied!', 'invoicing'); ?></div>
39 39
     </div>
40 40
 </div>
41 41
 
Please login to merge, or discard this patch.
templates/payment-forms/elements/price_input.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,32 +7,32 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Set the currency position.
13 13
 $position = wpinv_currency_position();
14 14
 
15
-if ( $position == 'left_space' ) {
15
+if ($position == 'left_space') {
16 16
     $position = 'left';
17 17
 }
18 18
 
19
-if ( $position == 'right_space' ) {
19
+if ($position == 'right_space') {
20 20
     $position = 'right';
21 21
 }
22
-$label       = empty( $label ) ? '' : esc_html( $label );
23
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
22
+$label       = empty($label) ? '' : esc_html($label);
23
+$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
24 24
 
25 25
 echo aui()->input(
26 26
     array(
27
-        'name'              => esc_attr( $id ),
28
-        'id'                => esc_attr( $id ) . uniqid( '_' ),
29
-        'placeholder'       => empty( $placeholder ) ? wpinv_format_amount( 0 ) : wpinv_format_amount( $placeholder ),
30
-        'value'             => empty( $value ) ? wpinv_format_amount( 0 ) : wpinv_format_amount( $value ),
31
-        'label'             => empty( $label ) ? '' : wp_kses_post( $label ),
27
+        'name'              => esc_attr($id),
28
+        'id'                => esc_attr($id) . uniqid('_'),
29
+        'placeholder'       => empty($placeholder) ? wpinv_format_amount(0) : wpinv_format_amount($placeholder),
30
+        'value'             => empty($value) ? wpinv_format_amount(0) : wpinv_format_amount($value),
31
+        'label'             => empty($label) ? '' : wp_kses_post($label),
32 32
         'label_type'        => 'vertical',
33
-        'help_text'         => empty( $description ) ? '' : wp_kses_post( $description ),
34
-        'input_group_right' => $position == 'right' ? wpinv_currency_symbol( $form->get_currency() ) : '',
35
-        'input_group_left'  => $position == 'left' ? wpinv_currency_symbol( $form->get_currency() ) : '',
33
+        'help_text'         => empty($description) ? '' : wp_kses_post($description),
34
+        'input_group_right' => $position == 'right' ? wpinv_currency_symbol($form->get_currency()) : '',
35
+        'input_group_left'  => $position == 'left' ? wpinv_currency_symbol($form->get_currency()) : '',
36 36
         'class'             => 'getpaid-refresh-on-change ' . $label_class,
37 37
     )
38 38
 );
Please login to merge, or discard this patch.
templates/payment-forms/elements/price_select.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -7,35 +7,35 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 // Ensure that we have options.
13
-if ( empty( $options ) ) {
13
+if (empty($options)) {
14 14
     return;
15 15
 }
16 16
 
17 17
 // Prepare price options.
18
-$options = getpaid_convert_price_string_to_options( $options );
19
-$keys    = array_keys( $options );
20
-$value   = empty( $options ) ? '' : $keys[0];
18
+$options = getpaid_convert_price_string_to_options($options);
19
+$keys    = array_keys($options);
20
+$value   = empty($options) ? '' : $keys[0];
21 21
 
22 22
 // Prepare id.
23
-$id = esc_attr( $id );
23
+$id = esc_attr($id);
24 24
 
25
-$select_type = empty( $select_type ) ? 'select' : $select_type;
25
+$select_type = empty($select_type) ? 'select' : $select_type;
26 26
 
27 27
 // Item select;
28
-if ( $select_type == 'select' ) {
28
+if ($select_type == 'select') {
29 29
     echo aui()->select(
30 30
         array(
31 31
             'name'        => $id,
32
-            'id'          => $id . uniqid( '_' ),
33
-            'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
32
+            'id'          => $id . uniqid('_'),
33
+            'placeholder' => empty($placeholder) ? '' : esc_attr($placeholder),
34 34
             'value'       => $value,
35
-            'label'       => empty( $label ) ? '' : esc_html( $label ),
35
+            'label'       => empty($label) ? '' : esc_html($label),
36 36
             'label_type'  => 'vertical',
37 37
             'class'       => 'getpaid-price-select-dropdown getpaid-refresh-on-change',
38
-            'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
38
+            'help_text'   => empty($description) ? '' : wp_kses_post($description),
39 39
             'options'     => $options,
40 40
         )
41 41
     );
@@ -43,18 +43,18 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 // Item radios;
46
-if ( $select_type == 'radios' ) {
46
+if ($select_type == 'radios') {
47 47
     echo aui()->radio(
48 48
         array(
49
-            'name'       => esc_attr( $id ),
50
-            'id'         => esc_attr( $id ) . uniqid( '_' ),
51
-            'label'      => empty( $label ) ? '' : esc_html( $label ),
49
+            'name'       => esc_attr($id),
50
+            'id'         => esc_attr($id) . uniqid('_'),
51
+            'label'      => empty($label) ? '' : esc_html($label),
52 52
             'label_type' => 'vertical',
53 53
             'class'      => 'getpaid-price-select-radio getpaid-refresh-on-change w-100',
54 54
             'value'      => $value,
55 55
             'inline'     => false,
56 56
             'options'    => $options,
57
-            'help_text'  => empty( $description ) ? '' : wp_kses_post( $description ),
57
+            'help_text'  => empty($description) ? '' : wp_kses_post($description),
58 58
         )
59 59
     );
60 60
     return;
@@ -62,30 +62,30 @@  discard block
 block discarded – undo
62 62
 
63 63
 
64 64
 // Display the label.
65
-if ( ! empty( $label ) ) {
66
-    $label = esc_html( $label );
65
+if (!empty($label)) {
66
+    $label = esc_html($label);
67 67
     echo "<label>$label</label>";
68 68
 }
69 69
 
70 70
 // Item buttons;
71
-if ( $select_type == 'buttons' || $select_type == 'circles' ) {
71
+if ($select_type == 'buttons' || $select_type == 'circles') {
72 72
 
73 73
     $class = 'getpaid-price-buttons';
74 74
 
75
-    if ( $select_type == 'circles' ) {
75
+    if ($select_type == 'circles') {
76 76
         $class .= ' getpaid-price-circles';
77 77
     }
78 78
     echo "<div class='$class'>";
79 79
 
80
-    foreach ( $options as $price => $label ) {
81
-        $label   = esc_html( $label );
82
-        $price   = esc_attr( $price );
83
-        $_id     = $id . uniqid( '_' );
84
-        $checked = checked( $price, $value, false );
80
+    foreach ($options as $price => $label) {
81
+        $label   = esc_html($label);
82
+        $price   = esc_attr($price);
83
+        $_id     = $id . uniqid('_');
84
+        $checked = checked($price, $value, false);
85 85
 
86 86
         $class = 'rounded';
87 87
 
88
-        if ( $select_type == 'circles' ) {
88
+        if ($select_type == 'circles') {
89 89
             $class = '';
90 90
         }
91 91
         echo "
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // Item checkboxes;
104
-if ( $select_type == 'checkboxes' ) {
104
+if ($select_type == 'checkboxes') {
105 105
     echo '<div class="form-group">';
106 106
 
107
-    foreach ( $options as $price => $label ) {
108
-        $label   = esc_html( $label );
109
-        $price   = esc_attr( $price );
110
-        $checked = checked( $price, $value, false );
107
+    foreach ($options as $price => $label) {
108
+        $label   = esc_html($label);
109
+        $price   = esc_attr($price);
110
+        $checked = checked($price, $value, false);
111 111
         echo "
112 112
             <label class='d-block'>
113 113
                 <input type='checkbox' class='getpaid-price-select-checkbox getpaid-refresh-on-change w-auto' name='{$id}[]' value='$price' $checked />
@@ -120,6 +120,6 @@  discard block
 block discarded – undo
120 120
 
121 121
 }
122 122
 
123
-if ( ! empty( $description ) ) {
123
+if (!empty($description)) {
124 124
     echo "<small class='form-text text-muted'>$description</small>";
125 125
 }
Please login to merge, or discard this patch.
templates/payment-forms/elements/address-fields.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -12,75 +12,75 @@  discard block
 block discarded – undo
12 12
  * @var GetPaid_Payment_Form $form
13 13
  */
14 14
 
15
-defined( 'ABSPATH' ) || exit;
15
+defined('ABSPATH') || exit;
16 16
 
17
-$field_type = sanitize_key( $field_type );
17
+$field_type = sanitize_key($field_type);
18 18
 
19 19
 echo "<div class='row $field_type'>";
20 20
 
21 21
 // Prepare current user.
22
-if ( ! empty( $form->invoice ) ) {
22
+if (!empty($form->invoice)) {
23 23
     $user_id = $form->invoice->get_user_id();
24 24
 }
25 25
 
26
-if ( empty( $user_id ) && is_user_logged_in() ) {
26
+if (empty($user_id) && is_user_logged_in()) {
27 27
     $user_id = get_current_user_id();
28 28
 }
29 29
 
30
-if ( ! empty( $user_id ) ) {
31
-    $user  = wp_get_current_user();
30
+if (!empty($user_id)) {
31
+    $user = wp_get_current_user();
32 32
 }
33 33
 
34
-foreach ( $fields as $address_field ) {
34
+foreach ($fields as $address_field) {
35 35
 
36 36
     // Skip if it is hidden.
37
-    if ( empty( $address_field['visible'] ) ) {
37
+    if (empty($address_field['visible'])) {
38 38
         continue;
39 39
     }
40 40
 
41
-    do_action( 'getpaid_payment_form_address_field_before_' . $address_field['name'], $field_type, $address_field );
41
+    do_action('getpaid_payment_form_address_field_before_' . $address_field['name'], $field_type, $address_field);
42 42
 
43 43
     // Prepare variables.
44 44
     $field_name  = $address_field['name'];
45 45
     $field_name  = "{$field_type}[$field_name]";
46
-    $wrap_class  = getpaid_get_form_element_grid_class( $address_field );
47
-    $wrap_class  = esc_attr( "$wrap_class getpaid-address-field-wrapper" );
48
-    $placeholder = empty( $address_field['placeholder'] ) ? '' : esc_attr( $address_field['placeholder'] );
49
-    $description = empty( $address_field['description'] ) ? '' : wp_kses_post( $address_field['description'] );
50
-    $value       = ! empty( $user_id ) ? get_user_meta( $user_id, '_' . $address_field['name'], true ) : '';
51
-    $label       = empty( $address_field['label'] ) ? '' : wp_kses_post( $address_field['label'] );
52
-
53
-    $method_name = 'get_' . str_replace( 'wpinv_', '', $address_field['name'] );
54
-    if ( ! empty( $form->invoice ) && is_callable( array( $form->invoice, $method_name ) ) ) {
55
-        $value = call_user_func( array( $form->invoice, $method_name ) );
46
+    $wrap_class  = getpaid_get_form_element_grid_class($address_field);
47
+    $wrap_class  = esc_attr("$wrap_class getpaid-address-field-wrapper");
48
+    $placeholder = empty($address_field['placeholder']) ? '' : esc_attr($address_field['placeholder']);
49
+    $description = empty($address_field['description']) ? '' : wp_kses_post($address_field['description']);
50
+    $value       = !empty($user_id) ? get_user_meta($user_id, '_' . $address_field['name'], true) : '';
51
+    $label       = empty($address_field['label']) ? '' : wp_kses_post($address_field['label']);
52
+
53
+    $method_name = 'get_' . str_replace('wpinv_', '', $address_field['name']);
54
+    if (!empty($form->invoice) && is_callable(array($form->invoice, $method_name))) {
55
+        $value = call_user_func(array($form->invoice, $method_name));
56 56
     }
57 57
 
58
-    if ( empty( $value ) && 'wpinv_first_name' == $address_field['name'] && ! empty( $user ) ) {
58
+    if (empty($value) && 'wpinv_first_name' == $address_field['name'] && !empty($user)) {
59 59
         $value = $user->first_name;
60 60
     }
61 61
 
62
-    if ( empty( $value ) && 'wpinv_last_name' == $address_field['name'] && ! empty( $user ) ) {
62
+    if (empty($value) && 'wpinv_last_name' == $address_field['name'] && !empty($user)) {
63 63
         $value = $user->last_name;
64 64
     }
65 65
 
66
-    if ( ! empty( $address_field['required'] ) ) {
66
+    if (!empty($address_field['required'])) {
67 67
         $label .= "<span class='text-danger'> *</span>";
68 68
     }
69 69
 
70 70
     // Display the country.
71
-    if ( 'wpinv_country' == $address_field['name'] ) {
71
+    if ('wpinv_country' == $address_field['name']) {
72 72
 
73 73
         echo "<div class='form-group $wrap_class getpaid-address-field-wrapper__country'";
74 74
 
75 75
         echo aui()->select(
76 76
             array(
77 77
                 'options'          => wpinv_get_country_list(),
78
-                'name'             => esc_attr( $field_name ),
79
-                'id'               => sanitize_html_class( $field_name ) . $uniqid,
80
-                'value'            => esc_attr( $country ),
78
+                'name'             => esc_attr($field_name),
79
+                'id'               => sanitize_html_class($field_name) . $uniqid,
80
+                'value'            => esc_attr($country),
81 81
                 'placeholder'      => $placeholder,
82
-                'required'         => ! empty( $address_field['required'] ),
83
-                'label'            => wp_kses_post( $label ),
82
+                'required'         => !empty($address_field['required']),
83
+                'label'            => wp_kses_post($label),
84 84
                 'label_type'       => 'vertical',
85 85
                 'help_text'        => $description,
86 86
                 'class'            => 'getpaid-address-field wpinv_country',
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             )
94 94
         );
95 95
 
96
-        if ( wpinv_should_validate_vat_number() ) {
96
+        if (wpinv_should_validate_vat_number()) {
97 97
 
98 98
             echo aui()->input(
99 99
                 array(
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     'id'         => "shipping-toggle$uniqid",
103 103
                     'wrap_class' => 'getpaid-address-field-wrapper__address-confirm mt-1 d-none',
104 104
                     'required'   => false,
105
-                    'label'      => __( 'I certify that I live in the country selected above', 'invoicing' ) . "<span class='text-danger'> *</span>",
105
+                    'label'      => __('I certify that I live in the country selected above', 'invoicing') . "<span class='text-danger'> *</span>",
106 106
                     'value'      => 1,
107 107
                     'checked'    => true,
108 108
                     'class'      => 'w-auto',
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
     }
117 117
 
118 118
     // Display the state.
119
-    elseif ( 'wpinv_state' == $address_field['name'] ) {
119
+    elseif ('wpinv_state' == $address_field['name']) {
120 120
 
121
-        if ( empty( $value ) ) {
121
+        if (empty($value)) {
122 122
             $value = wpinv_get_default_state();
123 123
         }
124 124
 
@@ -128,15 +128,15 @@  discard block
 block discarded – undo
128 128
             $placeholder,
129 129
             $label,
130 130
             $description,
131
-            ! empty( $address_field['required'] ),
131
+            !empty($address_field['required']),
132 132
             $wrap_class,
133 133
             $field_name
134 134
         );
135 135
 
136 136
     } else {
137 137
 
138
-        $key      = str_replace( 'wpinv_', '', $address_field['name'] );
139
-        $key      = esc_attr( str_replace( '_', '-', $key ) );
138
+        $key      = str_replace('wpinv_', '', $address_field['name']);
139
+        $key      = esc_attr(str_replace('_', '-', $key));
140 140
         $autocomplete = '';
141 141
         $replacements = array(
142 142
             'zip'        => 'postal-code',
@@ -149,37 +149,37 @@  discard block
 block discarded – undo
149 149
         );
150 150
 
151 151
 
152
-        if ( isset( $replacements[ $key ] ) ) {
152
+        if (isset($replacements[$key])) {
153 153
             $autocomplete = array(
154
-                'autocomplete' => "$field_type {$replacements[ $key ]}",
154
+                'autocomplete' => "$field_type {$replacements[$key]}",
155 155
             );
156 156
         }
157 157
 
158 158
         $append = '';
159 159
 
160
-        if ( 'billing' === $field_type && wpinv_should_validate_vat_number() && 'vat-number' === $key ) {
161
-            $valid    = esc_attr__( 'Valid', 'invoicing' );
162
-            $invalid  = esc_attr__( 'Invalid', 'invoicing' );
163
-            $validate = esc_attr__( 'Validate', 'invoicing' );
160
+        if ('billing' === $field_type && wpinv_should_validate_vat_number() && 'vat-number' === $key) {
161
+            $valid    = esc_attr__('Valid', 'invoicing');
162
+            $invalid  = esc_attr__('Invalid', 'invoicing');
163
+            $validate = esc_attr__('Validate', 'invoicing');
164 164
             $append   = "<span class='btn btn-primary getpaid-vat-number-validate' data-valid='$valid' data-invalid='$invalid' data-validate='$validate'>$validate</span>";
165 165
         }
166 166
 
167
-        if ( 'billing' === $field_type ) {
168
-            $description .= '<div class="getpaid-error-' . sanitize_html_class( $field_name ) . ' getpaid-custom-payment-form-errors alert alert-danger d-none"></div>';
167
+        if ('billing' === $field_type) {
168
+            $description .= '<div class="getpaid-error-' . sanitize_html_class($field_name) . ' getpaid-custom-payment-form-errors alert alert-danger d-none"></div>';
169 169
         }
170 170
 
171 171
         echo aui()->input(
172 172
             array(
173
-                'name'              => esc_attr( $field_name ),
174
-                'id'                => sanitize_html_class( $field_name ) . $uniqid,
175
-                'required'          => ! empty( $address_field['required'] ),
173
+                'name'              => esc_attr($field_name),
174
+                'id'                => sanitize_html_class($field_name) . $uniqid,
175
+                'required'          => !empty($address_field['required']),
176 176
                 'placeholder'       => $placeholder,
177
-                'label'             => wp_kses_post( $label ),
177
+                'label'             => wp_kses_post($label),
178 178
                 'label_type'        => 'vertical',
179 179
                 'help_text'         => $description,
180 180
                 'type'              => 'text',
181
-                'value'             => esc_attr( $value ),
182
-                'class'             => 'getpaid-address-field ' . esc_attr( $address_field['name'] ),
181
+                'value'             => esc_attr($value),
182
+                'class'             => 'getpaid-address-field ' . esc_attr($address_field['name']),
183 183
                 'wrap_class'        => "$wrap_class getpaid-address-field-wrapper__$key",
184 184
                 'label_class'       => 'getpaid-address-field-label getpaid-address-field-label__' . $key,
185 185
                 'extra_attributes'  => $autocomplete,
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
     }
191 191
 
192
-    do_action( 'getpaid_payment_form_address_field_after_' . $address_field['name'], $field_type, $address_field );
192
+    do_action('getpaid_payment_form_address_field_after_' . $address_field['name'], $field_type, $address_field);
193 193
 }
194 194
 
195 195
 echo '</div>';
Please login to merge, or discard this patch.
templates/payment-forms/elements/billing_email.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,35 +7,35 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12 12
 $value = '';
13 13
 $class = '';
14 14
 
15
-if ( ! empty( $form->invoice ) ) {
16
-    $value   = sanitize_email( $form->invoice->get_email() );
17
-} elseif ( is_user_logged_in() ) {
15
+if (!empty($form->invoice)) {
16
+    $value = sanitize_email($form->invoice->get_email());
17
+} elseif (is_user_logged_in()) {
18 18
     $user  = wp_get_current_user();
19
-    $value = sanitize_email( $user->user_email );
19
+    $value = sanitize_email($user->user_email);
20 20
 }
21 21
 
22
-if ( ! empty( $value ) && ! empty( $hide_billing_email ) ) {
22
+if (!empty($value) && !empty($hide_billing_email)) {
23 23
     $class = 'd-none';
24 24
 }
25 25
 
26
-do_action( 'getpaid_before_payment_form_billing_email', $form );
26
+do_action('getpaid_before_payment_form_billing_email', $form);
27 27
 
28 28
 echo "<span class='$class'>";
29 29
 
30 30
 echo aui()->input(
31 31
     array(
32 32
         'name'             => 'billing_email',
33
-        'id'               => esc_attr( $id ) . uniqid( '_' ),
34
-        'placeholder'      => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
35
-        'required'         => ! empty( $required ),
36
-        'label'            => empty( $label ) ? '' : wp_kses_post( $label ) . '<span class="text-danger"> *</span>',
33
+        'id'               => esc_attr($id) . uniqid('_'),
34
+        'placeholder'      => empty($placeholder) ? '' : esc_attr($placeholder),
35
+        'required'         => !empty($required),
36
+        'label'            => empty($label) ? '' : wp_kses_post($label) . '<span class="text-danger"> *</span>',
37 37
         'label_type'       => 'vertical',
38
-        'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
38
+        'help_text'        => empty($description) ? '' : wp_kses_post($description),
39 39
         'type'             => 'email',
40 40
         'value'            => $value,
41 41
         'class'            => 'wpinv_billing_email',
@@ -47,4 +47,4 @@  discard block
 block discarded – undo
47 47
 
48 48
 echo '</span>';
49 49
 
50
-do_action( 'getpaid_after_payment_form_billing_email', $form );
50
+do_action('getpaid_after_payment_form_billing_email', $form);
Please login to merge, or discard this patch.
templates/payment-forms/elements/time.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+$label = empty($label) ? '' : wp_kses_post($label);
13
+$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
14 14
 
15
-if ( ! empty( $required ) ) {
15
+if (!empty($required)) {
16 16
     $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19 19
 echo aui()->input(
20 20
     array(
21
-        'name'        => esc_attr( $id ),
22
-        'id'          => esc_attr( $id ) . uniqid( '_' ),
23
-        'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
-        'required'    => ! empty( $required ),
21
+        'name'        => esc_attr($id),
22
+        'id'          => esc_attr($id) . uniqid('_'),
23
+        'placeholder' => empty($placeholder) ? '' : esc_attr($placeholder),
24
+        'required'    => !empty($required),
25 25
         'label'       => $label,
26 26
         'label_type'  => 'vertical',
27
-        'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
27
+        'help_text'   => empty($description) ? '' : wp_kses_post($description),
28 28
         'type'        => 'time',
29 29
         'class'       => $label_class,
30 30
     )
Please login to merge, or discard this patch.
templates/payment-forms/elements/pay_button.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,20 +7,20 @@  discard block
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$class = empty( $class ) ? 'btn-primary' : sanitize_html_class( $class );
13
-$label = empty( $label ) ? esc_attr__( 'Pay %price% »', 'invoicing' ) : esc_attr( $label );
14
-$free  = empty( $free ) ? esc_attr__( 'Continue »', 'invoicing' ) : esc_attr( $free );
12
+$class = empty($class) ? 'btn-primary' : sanitize_html_class($class);
13
+$label = empty($label) ? esc_attr__('Pay %price% »', 'invoicing') : esc_attr($label);
14
+$free  = empty($free) ? esc_attr__('Continue »', 'invoicing') : esc_attr($free);
15 15
 
16
-do_action( 'getpaid_before_payment_form_pay_button', $form );
16
+do_action('getpaid_before_payment_form_pay_button', $form);
17 17
 
18 18
 echo aui()->input(
19 19
     array(
20
-        'name'             => esc_attr( $id ),
21
-        'id'               => esc_attr( $id ) . uniqid( '_' ),
20
+        'name'             => esc_attr($id),
21
+        'id'               => esc_attr($id) . uniqid('_'),
22 22
         'value'            => $label,
23
-        'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
23
+        'help_text'        => empty($description) ? '' : wp_kses_post($description),
24 24
         'type'             => 'submit',
25 25
         'class'            => 'getpaid-payment-form-submit btn btn-block submit-button ' . $class,
26 26
         'extra_attributes' => array(
@@ -30,4 +30,4 @@  discard block
 block discarded – undo
30 30
     )
31 31
 );
32 32
 
33
-do_action( 'getpaid_after_payment_form_pay_button', $form );
33
+do_action('getpaid_after_payment_form_pay_button', $form);
Please login to merge, or discard this patch.
templates/payment-forms/elements/number.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -7,24 +7,24 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$label = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
12
+$label = empty($label) ? '' : wp_kses_post($label);
13
+$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
14 14
 
15
-if ( ! empty( $required ) ) {
15
+if (!empty($required)) {
16 16
     $label .= "<span class='text-danger'> *</span>";
17 17
 }
18 18
 
19 19
 echo aui()->input(
20 20
     array(
21
-        'name'        => esc_attr( $id ),
22
-        'id'          => esc_attr( $id ) . uniqid( '_' ),
23
-        'placeholder' => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
24
-        'required'    => ! empty( $required ),
21
+        'name'        => esc_attr($id),
22
+        'id'          => esc_attr($id) . uniqid('_'),
23
+        'placeholder' => empty($placeholder) ? '' : esc_attr($placeholder),
24
+        'required'    => !empty($required),
25 25
         'label'       => $label,
26 26
         'label_type'  => 'vertical',
27
-        'help_text'   => empty( $description ) ? '' : wp_kses_post( $description ),
27
+        'help_text'   => empty($description) ? '' : wp_kses_post($description),
28 28
         'type'        => 'number',
29 29
         'class'       => $label_class,
30 30
     )
Please login to merge, or discard this patch.
templates/payment-forms/elements/date.php 2 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -12,57 +12,57 @@
 block discarded – undo
12 12
 $label       = empty( $label ) ? '' : wp_kses_post( $label );
13 13
 $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14 14
 if ( ! empty( $required ) ) {
15
-	$label .= "<span class='text-danger'> *</span>";
15
+    $label .= "<span class='text-danger'> *</span>";
16 16
 }
17 17
 
18 18
 $disable_dates = array();
19 19
 
20 20
 if ( ! empty( $disabled_dates ) ) {
21
-	$disabled_dates = preg_replace( '/\s+/', '', $disabled_dates );
22
-	$disabled_dates = str_ireplace( 'today', current_time( 'Y-m-d' ), $disabled_dates );
23
-	$disabled_dates = array_filter( explode( ',', $disabled_dates ) );
21
+    $disabled_dates = preg_replace( '/\s+/', '', $disabled_dates );
22
+    $disabled_dates = str_ireplace( 'today', current_time( 'Y-m-d' ), $disabled_dates );
23
+    $disabled_dates = array_filter( explode( ',', $disabled_dates ) );
24 24
 
25
-	foreach ( $disabled_dates as $disabled_date ) {
25
+    foreach ( $disabled_dates as $disabled_date ) {
26 26
 
27
-		$disabled_date = trim( $disabled_date );
27
+        $disabled_date = trim( $disabled_date );
28 28
 
29
-		if ( false === strpos( $disabled_date, '|' ) ) {
30
-			$disable_dates[] = $disabled_date;
31
-			continue;
32
-		}
29
+        if ( false === strpos( $disabled_date, '|' ) ) {
30
+            $disable_dates[] = $disabled_date;
31
+            continue;
32
+        }
33 33
 
34
-		$disabled_date   = explode( '|', $disabled_date );
35
-		$disable_dates[] = array(
36
-			'from' => trim( $disabled_date[0] ),
37
-			'to'   => trim( $disabled_date[1] ),
38
-		);
34
+        $disabled_date   = explode( '|', $disabled_date );
35
+        $disable_dates[] = array(
36
+            'from' => trim( $disabled_date[0] ),
37
+            'to'   => trim( $disabled_date[1] ),
38
+        );
39 39
 
40
-	}
40
+    }
41 41
 }
42 42
 
43 43
 $options = array(
44
-	'data-default-date'     => empty( 'default_date' ) ? false : $default_date,
45
-	'data-min-date'         => empty( 'min_date' ) ? false : $min_date,
46
-	'data-max-date'         => empty( 'max_date' ) ? false : $max_date,
47
-	'data-mode'             => empty( 'mode' ) ? 'single' : $mode,
48
-	'data-alt-format'       => get_option( 'date_format', 'F j, Y' ),
49
-	'data-date-format'      => 'Y-m-d',
50
-	'data-alt-input'        => 'true',
51
-	'data-disable_alt'      => empty( $disabled_dates ) ? false : wp_json_encode( $disable_dates ),
52
-	'data-disable_days_alt' => empty( $disable_days ) ? false : wp_json_encode( wp_parse_id_list( $disable_days ) ),
44
+    'data-default-date'     => empty( 'default_date' ) ? false : $default_date,
45
+    'data-min-date'         => empty( 'min_date' ) ? false : $min_date,
46
+    'data-max-date'         => empty( 'max_date' ) ? false : $max_date,
47
+    'data-mode'             => empty( 'mode' ) ? 'single' : $mode,
48
+    'data-alt-format'       => get_option( 'date_format', 'F j, Y' ),
49
+    'data-date-format'      => 'Y-m-d',
50
+    'data-alt-input'        => 'true',
51
+    'data-disable_alt'      => empty( $disabled_dates ) ? false : wp_json_encode( $disable_dates ),
52
+    'data-disable_days_alt' => empty( $disable_days ) ? false : wp_json_encode( wp_parse_id_list( $disable_days ) ),
53 53
 );
54 54
 
55 55
 echo aui()->input(
56
-	array(
57
-		'name'             => esc_attr( $id ),
58
-		'id'               => esc_attr( $id ) . uniqid( '_' ),
59
-		'placeholder'      => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
60
-		'required'         => ! empty( $required ),
61
-		'label'            => $label,
62
-		'label_type'       => 'vertical',
63
-		'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
64
-		'type'             => 'datepicker',
65
-		'class'            => $label_class . ' getpaid-init-flatpickr flatpickr-input',
66
-		'extra_attributes' => array_filter( apply_filters( 'getpaid_date_field_attributes', $options ) ),
67
-	)
56
+    array(
57
+        'name'             => esc_attr( $id ),
58
+        'id'               => esc_attr( $id ) . uniqid( '_' ),
59
+        'placeholder'      => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
60
+        'required'         => ! empty( $required ),
61
+        'label'            => $label,
62
+        'label_type'       => 'vertical',
63
+        'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
64
+        'type'             => 'datepicker',
65
+        'class'            => $label_class . ' getpaid-init-flatpickr flatpickr-input',
66
+        'extra_attributes' => array_filter( apply_filters( 'getpaid_date_field_attributes', $options ) ),
67
+    )
68 68
 );
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,62 +7,62 @@
 block discarded – undo
7 7
  * @version 1.0.19
8 8
  */
9 9
 
10
-defined( 'ABSPATH' ) || exit;
10
+defined('ABSPATH') || exit;
11 11
 
12
-$label       = empty( $label ) ? '' : wp_kses_post( $label );
13
-$label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) );
14
-if ( ! empty( $required ) ) {
12
+$label       = empty($label) ? '' : wp_kses_post($label);
13
+$label_class = sanitize_key(preg_replace('/[^A-Za-z0-9_-]/', '-', $label));
14
+if (!empty($required)) {
15 15
 	$label .= "<span class='text-danger'> *</span>";
16 16
 }
17 17
 
18 18
 $disable_dates = array();
19 19
 
20
-if ( ! empty( $disabled_dates ) ) {
21
-	$disabled_dates = preg_replace( '/\s+/', '', $disabled_dates );
22
-	$disabled_dates = str_ireplace( 'today', current_time( 'Y-m-d' ), $disabled_dates );
23
-	$disabled_dates = array_filter( explode( ',', $disabled_dates ) );
20
+if (!empty($disabled_dates)) {
21
+	$disabled_dates = preg_replace('/\s+/', '', $disabled_dates);
22
+	$disabled_dates = str_ireplace('today', current_time('Y-m-d'), $disabled_dates);
23
+	$disabled_dates = array_filter(explode(',', $disabled_dates));
24 24
 
25
-	foreach ( $disabled_dates as $disabled_date ) {
25
+	foreach ($disabled_dates as $disabled_date) {
26 26
 
27
-		$disabled_date = trim( $disabled_date );
27
+		$disabled_date = trim($disabled_date);
28 28
 
29
-		if ( false === strpos( $disabled_date, '|' ) ) {
29
+		if (false === strpos($disabled_date, '|')) {
30 30
 			$disable_dates[] = $disabled_date;
31 31
 			continue;
32 32
 		}
33 33
 
34
-		$disabled_date   = explode( '|', $disabled_date );
34
+		$disabled_date   = explode('|', $disabled_date);
35 35
 		$disable_dates[] = array(
36
-			'from' => trim( $disabled_date[0] ),
37
-			'to'   => trim( $disabled_date[1] ),
36
+			'from' => trim($disabled_date[0]),
37
+			'to'   => trim($disabled_date[1]),
38 38
 		);
39 39
 
40 40
 	}
41 41
 }
42 42
 
43 43
 $options = array(
44
-	'data-default-date'     => empty( 'default_date' ) ? false : $default_date,
45
-	'data-min-date'         => empty( 'min_date' ) ? false : $min_date,
46
-	'data-max-date'         => empty( 'max_date' ) ? false : $max_date,
47
-	'data-mode'             => empty( 'mode' ) ? 'single' : $mode,
48
-	'data-alt-format'       => get_option( 'date_format', 'F j, Y' ),
44
+	'data-default-date'     => empty('default_date') ? false : $default_date,
45
+	'data-min-date'         => empty('min_date') ? false : $min_date,
46
+	'data-max-date'         => empty('max_date') ? false : $max_date,
47
+	'data-mode'             => empty('mode') ? 'single' : $mode,
48
+	'data-alt-format'       => get_option('date_format', 'F j, Y'),
49 49
 	'data-date-format'      => 'Y-m-d',
50 50
 	'data-alt-input'        => 'true',
51
-	'data-disable_alt'      => empty( $disabled_dates ) ? false : wp_json_encode( $disable_dates ),
52
-	'data-disable_days_alt' => empty( $disable_days ) ? false : wp_json_encode( wp_parse_id_list( $disable_days ) ),
51
+	'data-disable_alt'      => empty($disabled_dates) ? false : wp_json_encode($disable_dates),
52
+	'data-disable_days_alt' => empty($disable_days) ? false : wp_json_encode(wp_parse_id_list($disable_days)),
53 53
 );
54 54
 
55 55
 echo aui()->input(
56 56
 	array(
57
-		'name'             => esc_attr( $id ),
58
-		'id'               => esc_attr( $id ) . uniqid( '_' ),
59
-		'placeholder'      => empty( $placeholder ) ? '' : esc_attr( $placeholder ),
60
-		'required'         => ! empty( $required ),
57
+		'name'             => esc_attr($id),
58
+		'id'               => esc_attr($id) . uniqid('_'),
59
+		'placeholder'      => empty($placeholder) ? '' : esc_attr($placeholder),
60
+		'required'         => !empty($required),
61 61
 		'label'            => $label,
62 62
 		'label_type'       => 'vertical',
63
-		'help_text'        => empty( $description ) ? '' : wp_kses_post( $description ),
63
+		'help_text'        => empty($description) ? '' : wp_kses_post($description),
64 64
 		'type'             => 'datepicker',
65 65
 		'class'            => $label_class . ' getpaid-init-flatpickr flatpickr-input',
66
-		'extra_attributes' => array_filter( apply_filters( 'getpaid_date_field_attributes', $options ) ),
66
+		'extra_attributes' => array_filter(apply_filters('getpaid_date_field_attributes', $options)),
67 67
 	)
68 68
 );
Please login to merge, or discard this patch.