@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if ( ! defined( 'ABSPATH' ) ) { |
3 | - exit; |
|
3 | + exit; |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | /** |
@@ -10,32 +10,32 @@ discard block |
||
10 | 10 | class GetPaid_Form_Item extends WPInv_Item { |
11 | 11 | |
12 | 12 | /** |
13 | - * Stores a custom description for the item. |
|
14 | - * |
|
15 | - * @var string |
|
16 | - */ |
|
17 | - protected $custom_description = ''; |
|
18 | - |
|
19 | - /** |
|
20 | - * Stores the item quantity. |
|
21 | - * |
|
22 | - * @var int |
|
23 | - */ |
|
24 | - protected $quantity = 1; |
|
25 | - |
|
26 | - /** |
|
27 | - * Is this item required? |
|
28 | - * |
|
29 | - * @var int |
|
30 | - */ |
|
31 | - protected $is_required = true; |
|
32 | - |
|
33 | - /** |
|
34 | - * Are quantities allowed? |
|
35 | - * |
|
36 | - * @var int |
|
37 | - */ |
|
38 | - protected $allow_quantities = false; |
|
13 | + * Stores a custom description for the item. |
|
14 | + * |
|
15 | + * @var string |
|
16 | + */ |
|
17 | + protected $custom_description = ''; |
|
18 | + |
|
19 | + /** |
|
20 | + * Stores the item quantity. |
|
21 | + * |
|
22 | + * @var int |
|
23 | + */ |
|
24 | + protected $quantity = 1; |
|
25 | + |
|
26 | + /** |
|
27 | + * Is this item required? |
|
28 | + * |
|
29 | + * @var int |
|
30 | + */ |
|
31 | + protected $is_required = true; |
|
32 | + |
|
33 | + /** |
|
34 | + * Are quantities allowed? |
|
35 | + * |
|
36 | + * @var int |
|
37 | + */ |
|
38 | + protected $allow_quantities = false; |
|
39 | 39 | |
40 | 40 | /* |
41 | 41 | |-------------------------------------------------------------------------- |
@@ -53,109 +53,109 @@ discard block |
||
53 | 53 | */ |
54 | 54 | |
55 | 55 | /** |
56 | - * Get the item name. |
|
57 | - * |
|
58 | - * @since 1.0.19 |
|
59 | - * @param string $context View or edit context. |
|
60 | - * @return string |
|
61 | - */ |
|
62 | - public function get_name( $context = 'view' ) { |
|
63 | - $name = parent::get_name( $context ); |
|
64 | - return $name . wpinv_get_item_suffix( $this ); |
|
65 | - } |
|
66 | - |
|
67 | - /** |
|
68 | - * Get the item description. |
|
69 | - * |
|
70 | - * @since 1.0.19 |
|
71 | - * @param string $context View or edit context. |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function get_description( $context = 'view' ) { |
|
75 | - |
|
76 | - if ( ! empty( $this->custom_description ) ) { |
|
77 | - return $this->custom_description; |
|
78 | - } |
|
79 | - |
|
80 | - return parent::get_description( $context ); |
|
81 | - } |
|
56 | + * Get the item name. |
|
57 | + * |
|
58 | + * @since 1.0.19 |
|
59 | + * @param string $context View or edit context. |
|
60 | + * @return string |
|
61 | + */ |
|
62 | + public function get_name( $context = 'view' ) { |
|
63 | + $name = parent::get_name( $context ); |
|
64 | + return $name . wpinv_get_item_suffix( $this ); |
|
65 | + } |
|
66 | + |
|
67 | + /** |
|
68 | + * Get the item description. |
|
69 | + * |
|
70 | + * @since 1.0.19 |
|
71 | + * @param string $context View or edit context. |
|
72 | + * @return string |
|
73 | + */ |
|
74 | + public function get_description( $context = 'view' ) { |
|
75 | + |
|
76 | + if ( ! empty( $this->custom_description ) ) { |
|
77 | + return $this->custom_description; |
|
78 | + } |
|
79 | + |
|
80 | + return parent::get_description( $context ); |
|
81 | + } |
|
82 | 82 | |
83 | - /** |
|
84 | - * Get the item qantity. |
|
85 | - * |
|
86 | - * @since 1.0.19 |
|
87 | - * @param string $context View or edit context. |
|
88 | - * @return int |
|
89 | - */ |
|
90 | - public function get_qantity( $context = 'view' ) { |
|
91 | - $quantity = (int) $this->quantity; |
|
92 | - |
|
93 | - if ( empty( $quantity ) || 1 > $quantity ) { |
|
94 | - $quantity = 1; |
|
95 | - } |
|
96 | - |
|
97 | - if ( 'view' == $context ) { |
|
98 | - return apply_filters( 'getpaid_payment_form_item_quanity', $quantity, $this ); |
|
99 | - } |
|
100 | - |
|
101 | - return $quantity; |
|
102 | - |
|
103 | - } |
|
104 | - |
|
105 | - /** |
|
106 | - * Returns whether or not customers can update the item quantity. |
|
107 | - * |
|
108 | - * @since 1.0.19 |
|
109 | - * @param string $context View or edit context. |
|
110 | - * @return bool |
|
111 | - */ |
|
112 | - public function get_allow_quantities( $context = 'view' ) { |
|
113 | - $allow_quantities = (bool) $this->allow_quantities; |
|
114 | - |
|
115 | - if ( 'view' == $context ) { |
|
116 | - return apply_filters( 'getpaid_payment_form_item_allow_quantities', $allow_quantities, $this ); |
|
117 | - } |
|
118 | - |
|
119 | - return $allow_quantities; |
|
120 | - |
|
121 | - } |
|
122 | - |
|
123 | - /** |
|
124 | - * Returns whether or not the item is required. |
|
125 | - * |
|
126 | - * @since 1.0.19 |
|
127 | - * @param string $context View or edit context. |
|
128 | - * @return bool |
|
129 | - */ |
|
130 | - public function get_is_required( $context = 'view' ) { |
|
131 | - $is_required = (bool) $this->is_required; |
|
132 | - |
|
133 | - if ( 'view' == $context ) { |
|
134 | - return apply_filters( 'getpaid_payment_form_item_is_required', $is_required, $this ); |
|
135 | - } |
|
136 | - |
|
137 | - return $is_required; |
|
138 | - |
|
139 | - } |
|
140 | - |
|
141 | - /** |
|
142 | - * Prepares form data for use. |
|
143 | - * |
|
144 | - * @since 1.0.19 |
|
145 | - * @param string $context View or edit context. |
|
146 | - * @return array |
|
147 | - */ |
|
148 | - public function prepare_data_for_use() { |
|
149 | - |
|
150 | - return array( |
|
151 | - 'title' => sanitize_text_field( $this->get_name() ), |
|
152 | - 'id' => $this->get_id(), |
|
153 | - 'price' => $this->get_price(), |
|
154 | - 'recurring' => $this->is_recurring(), |
|
155 | - 'description' => $this->get_description(), |
|
156 | - 'allow_quantities' => $this->get_allow_quantities(), |
|
83 | + /** |
|
84 | + * Get the item qantity. |
|
85 | + * |
|
86 | + * @since 1.0.19 |
|
87 | + * @param string $context View or edit context. |
|
88 | + * @return int |
|
89 | + */ |
|
90 | + public function get_qantity( $context = 'view' ) { |
|
91 | + $quantity = (int) $this->quantity; |
|
92 | + |
|
93 | + if ( empty( $quantity ) || 1 > $quantity ) { |
|
94 | + $quantity = 1; |
|
95 | + } |
|
96 | + |
|
97 | + if ( 'view' == $context ) { |
|
98 | + return apply_filters( 'getpaid_payment_form_item_quanity', $quantity, $this ); |
|
99 | + } |
|
100 | + |
|
101 | + return $quantity; |
|
102 | + |
|
103 | + } |
|
104 | + |
|
105 | + /** |
|
106 | + * Returns whether or not customers can update the item quantity. |
|
107 | + * |
|
108 | + * @since 1.0.19 |
|
109 | + * @param string $context View or edit context. |
|
110 | + * @return bool |
|
111 | + */ |
|
112 | + public function get_allow_quantities( $context = 'view' ) { |
|
113 | + $allow_quantities = (bool) $this->allow_quantities; |
|
114 | + |
|
115 | + if ( 'view' == $context ) { |
|
116 | + return apply_filters( 'getpaid_payment_form_item_allow_quantities', $allow_quantities, $this ); |
|
117 | + } |
|
118 | + |
|
119 | + return $allow_quantities; |
|
120 | + |
|
121 | + } |
|
122 | + |
|
123 | + /** |
|
124 | + * Returns whether or not the item is required. |
|
125 | + * |
|
126 | + * @since 1.0.19 |
|
127 | + * @param string $context View or edit context. |
|
128 | + * @return bool |
|
129 | + */ |
|
130 | + public function get_is_required( $context = 'view' ) { |
|
131 | + $is_required = (bool) $this->is_required; |
|
132 | + |
|
133 | + if ( 'view' == $context ) { |
|
134 | + return apply_filters( 'getpaid_payment_form_item_is_required', $is_required, $this ); |
|
135 | + } |
|
136 | + |
|
137 | + return $is_required; |
|
138 | + |
|
139 | + } |
|
140 | + |
|
141 | + /** |
|
142 | + * Prepares form data for use. |
|
143 | + * |
|
144 | + * @since 1.0.19 |
|
145 | + * @param string $context View or edit context. |
|
146 | + * @return array |
|
147 | + */ |
|
148 | + public function prepare_data_for_use() { |
|
149 | + |
|
150 | + return array( |
|
151 | + 'title' => sanitize_text_field( $this->get_name() ), |
|
152 | + 'id' => $this->get_id(), |
|
153 | + 'price' => $this->get_price(), |
|
154 | + 'recurring' => $this->is_recurring(), |
|
155 | + 'description' => $this->get_description(), |
|
156 | + 'allow_quantities' => $this->get_allow_quantities(), |
|
157 | 157 | ); |
158 | - } |
|
158 | + } |
|
159 | 159 | |
160 | 160 | /* |
161 | 161 | |-------------------------------------------------------------------------- |
@@ -167,60 +167,60 @@ discard block |
||
167 | 167 | | object. |
168 | 168 | */ |
169 | 169 | |
170 | - /** |
|
171 | - * Set the item qantity. |
|
172 | - * |
|
173 | - * @since 1.0.19 |
|
174 | - * @param int $quantity The item quantity. |
|
175 | - */ |
|
176 | - public function set_quantity( $quantity ) { |
|
177 | - |
|
178 | - if ( empty( $quantity ) || ! is_numeric( $quantity ) ) { |
|
179 | - $quantity = 1; |
|
180 | - } |
|
181 | - |
|
182 | - $this->quantity = $quantity; |
|
183 | - |
|
184 | - } |
|
185 | - |
|
186 | - /** |
|
187 | - * Set whether or not the quantities are allowed. |
|
188 | - * |
|
189 | - * @since 1.0.19 |
|
190 | - * @param bool $allow_quantities |
|
191 | - */ |
|
192 | - public function set_allow_quantities( $allow_quantities ) { |
|
193 | - $this->allow_quantities = (bool) $allow_quantities; |
|
194 | - } |
|
195 | - |
|
196 | - /** |
|
197 | - * Set whether or not the item is required. |
|
198 | - * |
|
199 | - * @since 1.0.19 |
|
200 | - * @param bool $is_required |
|
201 | - */ |
|
202 | - public function set_is_required( $is_required ) { |
|
203 | - $this->is_required = (bool) $is_required; |
|
204 | - } |
|
205 | - |
|
206 | - /** |
|
207 | - * Sets the custom item description. |
|
208 | - * |
|
209 | - * @since 1.0.19 |
|
210 | - * @param string $description |
|
211 | - */ |
|
212 | - public function set_custom_description( $description ) { |
|
213 | - $this->custom_description = $description; |
|
214 | - } |
|
170 | + /** |
|
171 | + * Set the item qantity. |
|
172 | + * |
|
173 | + * @since 1.0.19 |
|
174 | + * @param int $quantity The item quantity. |
|
175 | + */ |
|
176 | + public function set_quantity( $quantity ) { |
|
177 | + |
|
178 | + if ( empty( $quantity ) || ! is_numeric( $quantity ) ) { |
|
179 | + $quantity = 1; |
|
180 | + } |
|
181 | + |
|
182 | + $this->quantity = $quantity; |
|
183 | + |
|
184 | + } |
|
185 | + |
|
186 | + /** |
|
187 | + * Set whether or not the quantities are allowed. |
|
188 | + * |
|
189 | + * @since 1.0.19 |
|
190 | + * @param bool $allow_quantities |
|
191 | + */ |
|
192 | + public function set_allow_quantities( $allow_quantities ) { |
|
193 | + $this->allow_quantities = (bool) $allow_quantities; |
|
194 | + } |
|
195 | + |
|
196 | + /** |
|
197 | + * Set whether or not the item is required. |
|
198 | + * |
|
199 | + * @since 1.0.19 |
|
200 | + * @param bool $is_required |
|
201 | + */ |
|
202 | + public function set_is_required( $is_required ) { |
|
203 | + $this->is_required = (bool) $is_required; |
|
204 | + } |
|
205 | + |
|
206 | + /** |
|
207 | + * Sets the custom item description. |
|
208 | + * |
|
209 | + * @since 1.0.19 |
|
210 | + * @param string $description |
|
211 | + */ |
|
212 | + public function set_custom_description( $description ) { |
|
213 | + $this->custom_description = $description; |
|
214 | + } |
|
215 | 215 | |
216 | 216 | /** |
217 | 217 | * We do not want to save items to the database. |
218 | 218 | * |
219 | - * @return int item id |
|
219 | + * @return int item id |
|
220 | 220 | */ |
221 | 221 | public function save( $data = array() ) { |
222 | 222 | return $this->get_id(); |
223 | - } |
|
223 | + } |
|
224 | 224 | |
225 | 225 | /* |
226 | 226 | |-------------------------------------------------------------------------- |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | */ |
233 | 233 | |
234 | 234 | /** |
235 | - * Checks whether the item has enabled dynamic pricing. |
|
236 | - * |
|
237 | - * @since 1.0.19 |
|
238 | - * @return bool |
|
239 | - */ |
|
240 | - public function is_required() { |
|
235 | + * Checks whether the item has enabled dynamic pricing. |
|
236 | + * |
|
237 | + * @since 1.0.19 |
|
238 | + * @return bool |
|
239 | + */ |
|
240 | + public function is_required() { |
|
241 | 241 | return (bool) $this->get_is_required(); |
242 | - } |
|
242 | + } |
|
243 | 243 | |
244 | 244 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
2 | +if (!defined('ABSPATH')) { |
|
3 | 3 | exit; |
4 | 4 | } |
5 | 5 | |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | * @param string $context View or edit context. |
60 | 60 | * @return string |
61 | 61 | */ |
62 | - public function get_name( $context = 'view' ) { |
|
63 | - $name = parent::get_name( $context ); |
|
64 | - return $name . wpinv_get_item_suffix( $this ); |
|
62 | + public function get_name($context = 'view') { |
|
63 | + $name = parent::get_name($context); |
|
64 | + return $name . wpinv_get_item_suffix($this); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | * @param string $context View or edit context. |
72 | 72 | * @return string |
73 | 73 | */ |
74 | - public function get_description( $context = 'view' ) { |
|
74 | + public function get_description($context = 'view') { |
|
75 | 75 | |
76 | - if ( ! empty( $this->custom_description ) ) { |
|
76 | + if (!empty($this->custom_description)) { |
|
77 | 77 | return $this->custom_description; |
78 | 78 | } |
79 | 79 | |
80 | - return parent::get_description( $context ); |
|
80 | + return parent::get_description($context); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | * @param string $context View or edit context. |
88 | 88 | * @return int |
89 | 89 | */ |
90 | - public function get_qantity( $context = 'view' ) { |
|
90 | + public function get_qantity($context = 'view') { |
|
91 | 91 | $quantity = (int) $this->quantity; |
92 | 92 | |
93 | - if ( empty( $quantity ) || 1 > $quantity ) { |
|
93 | + if (empty($quantity) || 1 > $quantity) { |
|
94 | 94 | $quantity = 1; |
95 | 95 | } |
96 | 96 | |
97 | - if ( 'view' == $context ) { |
|
98 | - return apply_filters( 'getpaid_payment_form_item_quanity', $quantity, $this ); |
|
97 | + if ('view' == $context) { |
|
98 | + return apply_filters('getpaid_payment_form_item_quanity', $quantity, $this); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $quantity; |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @param string $context View or edit context. |
110 | 110 | * @return bool |
111 | 111 | */ |
112 | - public function get_allow_quantities( $context = 'view' ) { |
|
112 | + public function get_allow_quantities($context = 'view') { |
|
113 | 113 | $allow_quantities = (bool) $this->allow_quantities; |
114 | 114 | |
115 | - if ( 'view' == $context ) { |
|
116 | - return apply_filters( 'getpaid_payment_form_item_allow_quantities', $allow_quantities, $this ); |
|
115 | + if ('view' == $context) { |
|
116 | + return apply_filters('getpaid_payment_form_item_allow_quantities', $allow_quantities, $this); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | return $allow_quantities; |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | * @param string $context View or edit context. |
128 | 128 | * @return bool |
129 | 129 | */ |
130 | - public function get_is_required( $context = 'view' ) { |
|
130 | + public function get_is_required($context = 'view') { |
|
131 | 131 | $is_required = (bool) $this->is_required; |
132 | 132 | |
133 | - if ( 'view' == $context ) { |
|
134 | - return apply_filters( 'getpaid_payment_form_item_is_required', $is_required, $this ); |
|
133 | + if ('view' == $context) { |
|
134 | + return apply_filters('getpaid_payment_form_item_is_required', $is_required, $this); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | return $is_required; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | public function prepare_data_for_use() { |
149 | 149 | |
150 | 150 | return array( |
151 | - 'title' => sanitize_text_field( $this->get_name() ), |
|
151 | + 'title' => sanitize_text_field($this->get_name()), |
|
152 | 152 | 'id' => $this->get_id(), |
153 | 153 | 'price' => $this->get_price(), |
154 | 154 | 'recurring' => $this->is_recurring(), |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | * @since 1.0.19 |
174 | 174 | * @param int $quantity The item quantity. |
175 | 175 | */ |
176 | - public function set_quantity( $quantity ) { |
|
176 | + public function set_quantity($quantity) { |
|
177 | 177 | |
178 | - if ( empty( $quantity ) || ! is_numeric( $quantity ) ) { |
|
178 | + if (empty($quantity) || !is_numeric($quantity)) { |
|
179 | 179 | $quantity = 1; |
180 | 180 | } |
181 | 181 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * @since 1.0.19 |
190 | 190 | * @param bool $allow_quantities |
191 | 191 | */ |
192 | - public function set_allow_quantities( $allow_quantities ) { |
|
192 | + public function set_allow_quantities($allow_quantities) { |
|
193 | 193 | $this->allow_quantities = (bool) $allow_quantities; |
194 | 194 | } |
195 | 195 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @since 1.0.19 |
200 | 200 | * @param bool $is_required |
201 | 201 | */ |
202 | - public function set_is_required( $is_required ) { |
|
202 | + public function set_is_required($is_required) { |
|
203 | 203 | $this->is_required = (bool) $is_required; |
204 | 204 | } |
205 | 205 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | * @since 1.0.19 |
210 | 210 | * @param string $description |
211 | 211 | */ |
212 | - public function set_custom_description( $description ) { |
|
212 | + public function set_custom_description($description) { |
|
213 | 213 | $this->custom_description = $description; |
214 | 214 | } |
215 | 215 | |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * |
219 | 219 | * @return int item id |
220 | 220 | */ |
221 | - public function save( $data = array() ) { |
|
221 | + public function save($data = array()) { |
|
222 | 222 | return $this->get_id(); |
223 | 223 | } |
224 | 224 |
@@ -7,40 +7,40 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | // Make sure that the form is active. |
13 | -if ( ! $form->is_active() ) { |
|
13 | +if (!$form->is_active()) { |
|
14 | 14 | echo aui()->alert( |
15 | 15 | array( |
16 | 16 | 'type' => 'warning', |
17 | - 'content' => __( 'This payment form is no longer active', 'invoicing' ), |
|
17 | + 'content' => __('This payment form is no longer active', 'invoicing'), |
|
18 | 18 | ) |
19 | 19 | ); |
20 | 20 | return; |
21 | 21 | } |
22 | 22 | |
23 | 23 | // Display the payment form. |
24 | -do_action( 'getpaid_before_payment_form', $form ); |
|
24 | +do_action('getpaid_before_payment_form', $form); |
|
25 | 25 | |
26 | 26 | ?> |
27 | 27 | <form class='getpaid-payment-form'> |
28 | - <?php do_action( 'getpaid_payment_form_top', $form ); ?> |
|
29 | - <?php wp_nonce_field( 'getpaid_payment_form', 'getpaid_payment_form' ); ?> |
|
30 | - <?php wp_nonce_field( 'vat_validation', '_wpi_nonce' ); ?> |
|
28 | + <?php do_action('getpaid_payment_form_top', $form); ?> |
|
29 | + <?php wp_nonce_field('getpaid_payment_form', 'getpaid_payment_form'); ?> |
|
30 | + <?php wp_nonce_field('vat_validation', '_wpi_nonce'); ?> |
|
31 | 31 | <input type='hidden' name='form_id' value='<?php echo $form->get_id(); ?>'/> |
32 | - <?php do_action( 'getpaid_payment_form_before_elements', $form ); ?> |
|
32 | + <?php do_action('getpaid_payment_form_before_elements', $form); ?> |
|
33 | 33 | <?php |
34 | - foreach ( $form->get_elements() as $element ) { |
|
35 | - if ( isset( $element['type'] ) ) { |
|
36 | - do_action( 'getpaid_payment_form_element', $element, $form ); |
|
37 | - do_action( "getpaid_payment_form_element_{$element['type']}_template", $element, $form ); |
|
34 | + foreach ($form->get_elements() as $element) { |
|
35 | + if (isset($element['type'])) { |
|
36 | + do_action('getpaid_payment_form_element', $element, $form); |
|
37 | + do_action("getpaid_payment_form_element_{$element['type']}_template", $element, $form); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | ?> |
41 | - <?php do_action( 'getpaid_payment_form_after_elements', $form ); ?> |
|
41 | + <?php do_action('getpaid_payment_form_after_elements', $form); ?> |
|
42 | 42 | <div class='getpaid-payment-form-errors alert alert-danger d-none'></div> |
43 | - <?php do_action( 'getpaid_payment_form_bottom', $form ); ?> |
|
43 | + <?php do_action('getpaid_payment_form_bottom', $form); ?> |
|
44 | 44 | </form> |
45 | 45 | <?php |
46 | -do_action( 'getpaid_payment_form', $form ); |
|
46 | +do_action('getpaid_payment_form', $form); |
@@ -7,17 +7,17 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | echo aui()->input( |
13 | 13 | array( |
14 | - 'name' => esc_attr( $id ), |
|
15 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
16 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
17 | - 'required' => ! empty( $required ), |
|
18 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
14 | + 'name' => esc_attr($id), |
|
15 | + 'id' => esc_attr($id) . uniqid('_'), |
|
16 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
17 | + 'required' => !empty($required), |
|
18 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
19 | 19 | 'label_type' => 'vertical', |
20 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
20 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
21 | 21 | 'type' => 'datepicker', |
22 | 22 | ) |
23 | 23 | ); |
@@ -7,17 +7,17 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | echo aui()->input( |
13 | 13 | array( |
14 | - 'name' => esc_attr( $id ), |
|
15 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
16 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
17 | - 'required' => ! empty( $required ), |
|
18 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
14 | + 'name' => esc_attr($id), |
|
15 | + 'id' => esc_attr($id) . uniqid('_'), |
|
16 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
17 | + 'required' => !empty($required), |
|
18 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
19 | 19 | 'label_type' => 'vertical', |
20 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
20 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
21 | 21 | 'type' => 'number', |
22 | 22 | ) |
23 | 23 | ); |
@@ -7,16 +7,16 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | -if ( empty( $text ) ) { |
|
12 | +if (empty($text)) { |
|
13 | 13 | return; |
14 | 14 | } |
15 | 15 | |
16 | 16 | echo aui()->alert( |
17 | 17 | array( |
18 | - 'content' => wp_kses_post( $text ), |
|
19 | - 'dismissible' => ! empty( $dismissible ), |
|
20 | - 'type' => empty( $class ) ? 'info' : str_replace( 'alert-', '', $class ), |
|
18 | + 'content' => wp_kses_post($text), |
|
19 | + 'dismissible' => !empty($dismissible), |
|
20 | + 'type' => empty($class) ? 'info' : str_replace('alert-', '', $class), |
|
21 | 21 | ) |
22 | 22 | ); |
@@ -7,18 +7,18 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | echo aui()->radio( |
13 | 13 | array( |
14 | 14 | 'type' => 'checkbox', |
15 | - 'name' => esc_attr( $id ), |
|
16 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
17 | - 'required' => ! empty( $required ), |
|
18 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
15 | + 'name' => esc_attr($id), |
|
16 | + 'id' => esc_attr($id) . uniqid('_'), |
|
17 | + 'required' => !empty($required), |
|
18 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
19 | 19 | 'label_type' => 'vertical', |
20 | 20 | 'inline' => false, |
21 | - 'options' => empty( $options ) ? array() : array_combine( $options, $options ), |
|
22 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
21 | + 'options' => empty($options) ? array() : array_combine($options, $options), |
|
22 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
23 | 23 | ) |
24 | 24 | ); |
@@ -7,17 +7,17 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | echo aui()->select( |
13 | 13 | array( |
14 | - 'name' => esc_attr( $id ), |
|
15 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
16 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
17 | - 'required' => ! empty( $required ), |
|
18 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
14 | + 'name' => esc_attr($id), |
|
15 | + 'id' => esc_attr($id) . uniqid('_'), |
|
16 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
17 | + 'required' => !empty($required), |
|
18 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
19 | 19 | 'label_type' => 'vertical', |
20 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
21 | - 'options' => empty( $options ) ? array() : array_combine( $options, $options ), |
|
20 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
21 | + 'options' => empty($options) ? array() : array_combine($options, $options), |
|
22 | 22 | ) |
23 | 23 | ); |
@@ -7,6 +7,6 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | ?> |
12 | 12 | <hr class="featurette-divider" /> |
13 | 13 | \ No newline at end of file |
@@ -7,17 +7,17 @@ |
||
7 | 7 | * @version 1.0.19 |
8 | 8 | */ |
9 | 9 | |
10 | -defined( 'ABSPATH' ) || exit; |
|
10 | +defined('ABSPATH') || exit; |
|
11 | 11 | |
12 | 12 | echo aui()->input( |
13 | 13 | array( |
14 | - 'name' => esc_attr( $id ), |
|
15 | - 'id' => esc_attr( $id ) . uniqid( '_' ), |
|
16 | - 'placeholder'=> empty( $placeholder ) ? '' : esc_attr( $placeholder ), |
|
17 | - 'required' => ! empty( $required ), |
|
18 | - 'label' => empty( $label ) ? '' : wp_kses_post( $label ), |
|
14 | + 'name' => esc_attr($id), |
|
15 | + 'id' => esc_attr($id) . uniqid('_'), |
|
16 | + 'placeholder'=> empty($placeholder) ? '' : esc_attr($placeholder), |
|
17 | + 'required' => !empty($required), |
|
18 | + 'label' => empty($label) ? '' : wp_kses_post($label), |
|
19 | 19 | 'label_type' => 'vertical', |
20 | - 'help_text' => empty( $description ) ? '' : wp_kses_post( $description ), |
|
20 | + 'help_text' => empty($description) ? '' : wp_kses_post($description), |
|
21 | 21 | 'type' => 'url', |
22 | 22 | ) |
23 | 23 | ); |