@@ -7,23 +7,23 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->input( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | 'type' => 'number', |
28 | 28 | ) |
29 | 29 | ); |
@@ -7,23 +7,23 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->radio( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'required' => !empty($required), |
|
23 | 23 | 'label' => $label, |
24 | 24 | 'label_type' => 'vertical', |
25 | 25 | 'inline' => false, |
26 | - 'options' => empty( $options ) ? array() : array_combine( $options, $options ), |
|
27 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'options' => empty($options) ? array() : array_combine($options, $options), |
|
27 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
28 | 28 | ) |
29 | 29 | ); |
@@ -7,35 +7,35 @@ discard block |
||
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 ) ? '' : sanitize_text_field( $label ), |
|
35 | + 'label' => empty($label) ? '' : sanitize_text_field($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 |
||
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 ) ? '' : sanitize_text_field( $label ), |
|
49 | + 'name' => esc_attr($id), |
|
50 | + 'id' => esc_attr($id) . uniqid('_'), |
|
51 | + 'label' => empty($label) ? '' : sanitize_text_field($label), |
|
52 | 52 | 'label_type' => 'vertical', |
53 | 53 | 'class' => 'getpaid-price-select-radio getpaid-refresh-on-change', |
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 |
||
62 | 62 | |
63 | 63 | |
64 | 64 | // Display the label. |
65 | -if ( ! empty( $label ) ) { |
|
66 | - $label = sanitize_text_field( $label ); |
|
65 | +if (!empty($label)) { |
|
66 | + $label = sanitize_text_field($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 = sanitize_text_field( $label ); |
|
82 | - $price = esc_attr( $price ); |
|
83 | - $_id = $id . uniqid( '_' ); |
|
84 | - $checked = checked( $price, $value, false ); |
|
80 | + foreach ($options as $price => $label) { |
|
81 | + $label = sanitize_text_field($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 |
||
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 = sanitize_text_field( $label ); |
|
109 | - $price = esc_attr( $price ); |
|
110 | - $checked = checked( $price, $value, false ); |
|
107 | + foreach ($options as $price => $label) { |
|
108 | + $label = sanitize_text_field($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' name='{$id}[]' value='$price' $checked /> |
@@ -120,6 +120,6 @@ discard block |
||
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 | } |
@@ -7,23 +7,23 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->select( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
27 | - 'options' => empty( $options ) ? array() : array_combine( $options, $options ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | + 'options' => empty($options) ? array() : array_combine($options, $options), |
|
28 | 28 | ) |
29 | 29 | ); |
@@ -7,23 +7,23 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->input( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | 'type' => 'url', |
28 | 28 | ) |
29 | 29 | ); |
@@ -7,23 +7,23 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->input( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | 'type' => 'email', |
28 | 28 | ) |
29 | 29 | ); |
@@ -7,23 +7,23 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->input( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | 'type' => 'time', |
28 | 28 | ) |
29 | 29 | ); |
@@ -7,22 +7,22 @@ |
||
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 ); |
|
12 | +$label = empty($label) ? '' : wp_kses_post($label); |
|
13 | 13 | |
14 | -if ( ! empty( $required ) ) { |
|
14 | +if (!empty($required)) { |
|
15 | 15 | $label .= "<span class='text-danger'> *</span>"; |
16 | 16 | } |
17 | 17 | |
18 | 18 | echo aui()->input( |
19 | 19 | array( |
20 | - 'name' => esc_attr( $id ), |
|
21 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
22 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
23 | - 'required' => ! empty( $required ), |
|
20 | + 'name' => esc_attr($id), |
|
21 | + 'id' => esc_attr($id) . uniqid('_'), |
|
22 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
23 | + 'required' => !empty($required), |
|
24 | 24 | 'label' => $label, |
25 | 25 | 'label_type' => 'vertical', |
26 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
26 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
27 | 27 | ) |
28 | 28 | ); |
@@ -7,16 +7,16 @@ discard block |
||
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 ( is_user_logged_in() ) { |
|
15 | +if (is_user_logged_in()) { |
|
16 | 16 | $user = wp_get_current_user(); |
17 | - $value = sanitize_email( $user->user_email ); |
|
17 | + $value = sanitize_email($user->user_email); |
|
18 | 18 | |
19 | - if ( ! empty( $hide_billing_email ) ) { |
|
19 | + if (!empty($hide_billing_email)) { |
|
20 | 20 | $class = 'd-none'; |
21 | 21 | } |
22 | 22 | |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | echo aui()->input( |
28 | 28 | array( |
29 | 29 | 'name' => 'billing_email', |
30 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
31 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
32 | - 'required' => ! empty( $required ), |
|
33 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ) . '<span class="text-danger"> *</span>', |
|
30 | + 'id' => esc_attr($id) . uniqid('_'), |
|
31 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
32 | + 'required' => !empty($required), |
|
33 | + 'label' => empty($label) ? '' : wp_kses_post($label) . '<span class="text-danger"> *</span>', |
|
34 | 34 | 'label_type' => 'vertical', |
35 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
35 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
36 | 36 | 'type' => 'email', |
37 | 37 | 'value' => $value, |
38 | 38 | ) |