Conditions | 5 |
Paths | 16 |
Total Lines | 25 |
Lines | 3 |
Ratio | 12 % |
Changes | 0 |
1 | <?php |
||
20 | public static function prepareFields(array $input) |
||
21 | { |
||
22 | |||
23 | $args = []; |
||
24 | |||
25 | if (! empty($input['name'])) { |
||
26 | $args['TKT_name'] = sanitize_text_field($input['name']); |
||
27 | } |
||
28 | |||
29 | if (! empty($input['description'])) { |
||
30 | $args['TKT_description'] = sanitize_text_field($input['description']); |
||
31 | } |
||
32 | |||
33 | if (! empty($input['price'])) { |
||
34 | $args['TKT_price'] = floatval($input['price']); |
||
35 | } |
||
36 | |||
37 | View Code Duplication | if (! empty($input['datetimes'])) { |
|
38 | $args['datetimes'] = array_filter(array_map('absint', (array) $input['datetimes'])); |
||
39 | } |
||
40 | |||
41 | // Likewise the other fields... |
||
42 | |||
43 | return $args; |
||
44 | } |
||
45 | |||
66 |