@@ -13,19 +13,19 @@ |
||
13 | 13 | $label_class = sanitize_key( preg_replace( '/[^A-Za-z0-9_-]/', '-', $label ) ); |
14 | 14 | |
15 | 15 | if ( ! empty( $required ) ) { |
16 | - $label .= "<span class='text-danger'> *</span>"; |
|
16 | + $label .= "<span class='text-danger'> *</span>"; |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | aui()->input( |
20 | - array( |
|
21 | - 'type' => 'checkbox', |
|
22 | - 'name' => esc_attr( $id ), |
|
23 | - 'id' => esc_attr( $element_id ), |
|
24 | - 'required' => ! empty( $required ), |
|
25 | - 'label' => $label, |
|
26 | - 'value' => esc_attr__( 'Yes', 'invoicing' ), |
|
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
28 | - 'class' => $label_class |
|
29 | - ), |
|
30 | - true |
|
20 | + array( |
|
21 | + 'type' => 'checkbox', |
|
22 | + 'name' => esc_attr( $id ), |
|
23 | + 'id' => esc_attr( $element_id ), |
|
24 | + 'required' => ! empty( $required ), |
|
25 | + 'label' => $label, |
|
26 | + 'value' => esc_attr__( 'Yes', 'invoicing' ), |
|
27 | + 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
28 | + 'class' => $label_class |
|
29 | + ), |
|
30 | + true |
|
31 | 31 | ); |
@@ -7,24 +7,24 @@ |
||
7 | 7 | * @version 2.8.24 |
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 | aui()->input( |
20 | 20 | array( |
21 | 21 | 'type' => 'checkbox', |
22 | - 'name' => esc_attr( $id ), |
|
23 | - 'id' => esc_attr( $element_id ), |
|
24 | - 'required' => ! empty( $required ), |
|
22 | + 'name' => esc_attr($id), |
|
23 | + 'id' => esc_attr($element_id), |
|
24 | + 'required' => !empty($required), |
|
25 | 25 | 'label' => $label, |
26 | - 'value' => esc_attr__( 'Yes', 'invoicing' ), |
|
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'value' => esc_attr__('Yes', 'invoicing'), |
|
27 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
28 | 28 | 'class' => $label_class |
29 | 29 | ), |
30 | 30 | true |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | defined( 'ABSPATH' ) || exit; |
11 | 11 | |
12 | 12 | if ( empty( $fields ) ) { |
13 | - return; |
|
13 | + return; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | // A prefix for all ids (so that a form can be included in the same page multiple times). |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | |
19 | 19 | // Prepare the user's country. |
20 | 20 | if ( ! empty( $form->invoice ) ) { |
21 | - $country = $form->invoice->get_country(); |
|
21 | + $country = $form->invoice->get_country(); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | if ( empty( $country ) ) { |
25 | - $country = empty( $country ) ? getpaid_get_ip_country() : $country; |
|
26 | - $country = empty( $country ) ? wpinv_get_default_country() : $country; |
|
25 | + $country = empty( $country ) ? getpaid_get_ip_country() : $country; |
|
26 | + $country = empty( $country ) ? wpinv_get_default_country() : $country; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // A prefix for all ids (so that a form can be included in the same page multiple times). |
@@ -50,32 +50,32 @@ discard block |
||
50 | 50 | <!-- Start Billing Address --> |
51 | 51 | <div class="getpaid-billing-address-wrapper"> |
52 | 52 | <?php |
53 | - $field_type = 'billing'; |
|
53 | + $field_type = 'billing'; |
|
54 | 54 | |
55 | - wpinv_get_template( 'payment-forms/elements/address-fields.php', array( 'form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country ) ); |
|
55 | + wpinv_get_template( 'payment-forms/elements/address-fields.php', array( 'form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country ) ); |
|
56 | 56 | |
57 | - do_action( 'getpaid_after_payment_form_billing_fields', $form ); |
|
58 | - ?> |
|
57 | + do_action( 'getpaid_after_payment_form_billing_fields', $form ); |
|
58 | + ?> |
|
59 | 59 | </div> |
60 | 60 | <!-- End Billing Address --> |
61 | 61 | <?php endif; ?> |
62 | 62 | |
63 | 63 | <?php if ( 'both' === $address_type ) : ?> |
64 | 64 | <?php |
65 | - aui()->input( |
|
66 | - array( |
|
67 | - 'type' => 'checkbox', |
|
68 | - 'name' => 'same-shipping-address', |
|
69 | - 'id' => "shipping-toggle$uniqid", |
|
70 | - 'required' => false, |
|
71 | - 'label' => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ), |
|
72 | - 'value' => 1, |
|
73 | - 'checked' => true, |
|
74 | - 'class' => 'chkbox-same-shipping-address' |
|
75 | - ), |
|
76 | - true |
|
77 | - ); |
|
78 | - ?> |
|
65 | + aui()->input( |
|
66 | + array( |
|
67 | + 'type' => 'checkbox', |
|
68 | + 'name' => 'same-shipping-address', |
|
69 | + 'id' => "shipping-toggle$uniqid", |
|
70 | + 'required' => false, |
|
71 | + 'label' => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ), |
|
72 | + 'value' => 1, |
|
73 | + 'checked' => true, |
|
74 | + 'class' => 'chkbox-same-shipping-address' |
|
75 | + ), |
|
76 | + true |
|
77 | + ); |
|
78 | + ?> |
|
79 | 79 | <!-- Start Shipping Address Title --> |
80 | 80 | <h4 class="mb-3 getpaid-shipping-address-title"> |
81 | 81 | <?php esc_html_e( 'Shipping Address', 'invoicing' ); ?> |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | <!-- Start Shipping Address --> |
88 | 88 | <div class="getpaid-shipping-address-wrapper"> |
89 | 89 | <?php |
90 | - $field_type = 'shipping'; |
|
90 | + $field_type = 'shipping'; |
|
91 | 91 | |
92 | - wpinv_get_template( 'payment-forms/elements/address-fields.php', array( 'form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country ) ); |
|
92 | + wpinv_get_template( 'payment-forms/elements/address-fields.php', array( 'form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country ) ); |
|
93 | 93 | |
94 | - do_action( 'getpaid_after_payment_form_shipping_fields', $form ); |
|
95 | - ?> |
|
94 | + do_action( 'getpaid_after_payment_form_shipping_fields', $form ); |
|
95 | + ?> |
|
96 | 96 | </div> |
97 | 97 | <!-- End Shipping Address --> |
98 | 98 | <?php endif; ?> |
@@ -7,60 +7,60 @@ discard block |
||
7 | 7 | * @version 2.8.24 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $fields ) ) { |
|
12 | +if (empty($fields)) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | 15 | |
16 | 16 | // A prefix for all ids (so that a form can be included in the same page multiple times). |
17 | -$uniqid = uniqid( '_' ); |
|
17 | +$uniqid = uniqid('_'); |
|
18 | 18 | |
19 | 19 | // Prepare the user's country. |
20 | -if ( ! empty( $form->invoice ) ) { |
|
20 | +if (!empty($form->invoice)) { |
|
21 | 21 | $country = $form->invoice->get_country(); |
22 | 22 | } |
23 | 23 | |
24 | -if ( empty( $country ) ) { |
|
25 | - $country = empty( $country ) ? getpaid_get_ip_country() : $country; |
|
26 | - $country = empty( $country ) ? wpinv_get_default_country() : $country; |
|
24 | +if (empty($country)) { |
|
25 | + $country = empty($country) ? getpaid_get_ip_country() : $country; |
|
26 | + $country = empty($country) ? wpinv_get_default_country() : $country; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // A prefix for all ids (so that a form can be included in the same page multiple times). |
30 | -$uniqid = uniqid( '_' ); |
|
30 | +$uniqid = uniqid('_'); |
|
31 | 31 | |
32 | -$address_type = empty( $address_type ) ? 'billing' : $address_type; |
|
32 | +$address_type = empty($address_type) ? 'billing' : $address_type; |
|
33 | 33 | ?> |
34 | 34 | |
35 | -<?php if ( 'both' === $address_type ) : ?> |
|
35 | +<?php if ('both' === $address_type) : ?> |
|
36 | 36 | <!-- Start Billing/Shipping Address Title --> |
37 | 37 | <h4 class="mb-3 getpaid-shipping-billing-address-title"> |
38 | - <?php esc_html_e( 'Billing / Shipping Address', 'invoicing' ); ?> |
|
38 | + <?php esc_html_e('Billing / Shipping Address', 'invoicing'); ?> |
|
39 | 39 | </h4> |
40 | 40 | <!-- End Billing Address Title --> |
41 | 41 | |
42 | 42 | <!-- Start Billing Address Title --> |
43 | 43 | <h4 class="mb-3 getpaid-billing-address-title"> |
44 | - <?php esc_html_e( 'Billing Address', 'invoicing' ); ?> |
|
44 | + <?php esc_html_e('Billing Address', 'invoicing'); ?> |
|
45 | 45 | </h4> |
46 | 46 | <!-- End Billing Address Title --> |
47 | 47 | <?php endif; ?> |
48 | 48 | |
49 | -<?php if ( 'both' === $address_type || 'billing' === $address_type ) : ?> |
|
49 | +<?php if ('both' === $address_type || 'billing' === $address_type) : ?> |
|
50 | 50 | <!-- Start Billing Address --> |
51 | 51 | <div class="getpaid-billing-address-wrapper"> |
52 | 52 | <?php |
53 | 53 | $field_type = 'billing'; |
54 | 54 | |
55 | - wpinv_get_template( 'payment-forms/elements/address-fields.php', array( 'form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country ) ); |
|
55 | + wpinv_get_template('payment-forms/elements/address-fields.php', array('form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country)); |
|
56 | 56 | |
57 | - do_action( 'getpaid_after_payment_form_billing_fields', $form ); |
|
57 | + do_action('getpaid_after_payment_form_billing_fields', $form); |
|
58 | 58 | ?> |
59 | 59 | </div> |
60 | 60 | <!-- End Billing Address --> |
61 | 61 | <?php endif; ?> |
62 | 62 | |
63 | -<?php if ( 'both' === $address_type ) : ?> |
|
63 | +<?php if ('both' === $address_type) : ?> |
|
64 | 64 | <?php |
65 | 65 | aui()->input( |
66 | 66 | array( |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | 'name' => 'same-shipping-address', |
69 | 69 | 'id' => "shipping-toggle$uniqid", |
70 | 70 | 'required' => false, |
71 | - 'label' => empty( $shipping_address_toggle ) ? esc_html__( 'Same billing & shipping address.', 'invoicing' ) : wp_kses_post( $shipping_address_toggle ), |
|
71 | + 'label' => empty($shipping_address_toggle) ? esc_html__('Same billing & shipping address.', 'invoicing') : wp_kses_post($shipping_address_toggle), |
|
72 | 72 | 'value' => 1, |
73 | 73 | 'checked' => true, |
74 | 74 | 'class' => 'chkbox-same-shipping-address' |
@@ -78,20 +78,20 @@ discard block |
||
78 | 78 | ?> |
79 | 79 | <!-- Start Shipping Address Title --> |
80 | 80 | <h4 class="mb-3 getpaid-shipping-address-title"> |
81 | - <?php esc_html_e( 'Shipping Address', 'invoicing' ); ?> |
|
81 | + <?php esc_html_e('Shipping Address', 'invoicing'); ?> |
|
82 | 82 | </h4> |
83 | 83 | <!-- End Shipping Address Title --> |
84 | 84 | <?php endif; ?> |
85 | 85 | |
86 | -<?php if ( 'both' === $address_type || 'shipping' === $address_type ) : ?> |
|
86 | +<?php if ('both' === $address_type || 'shipping' === $address_type) : ?> |
|
87 | 87 | <!-- Start Shipping Address --> |
88 | 88 | <div class="getpaid-shipping-address-wrapper"> |
89 | 89 | <?php |
90 | 90 | $field_type = 'shipping'; |
91 | 91 | |
92 | - wpinv_get_template( 'payment-forms/elements/address-fields.php', array( 'form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country ) ); |
|
92 | + wpinv_get_template('payment-forms/elements/address-fields.php', array('form' => $form, 'fields' => $fields, 'address_type' => $address_type, 'field_type' => $field_type, 'uniqid' => $uniqid, 'country' => $country)); |
|
93 | 93 | |
94 | - do_action( 'getpaid_after_payment_form_shipping_fields', $form ); |
|
94 | + do_action('getpaid_after_payment_form_shipping_fields', $form); |
|
95 | 95 | ?> |
96 | 96 | </div> |
97 | 97 | <!-- End Shipping Address --> |