Conditions | 6 |
Paths | 32 |
Total Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public static function prepareFields(array $input) |
||
21 | { |
||
22 | |||
23 | $args = []; |
||
24 | |||
25 | if (! empty($input['event'])) { |
||
26 | $args['EVT_ID'] = absint($input['event']); |
||
27 | } |
||
28 | |||
29 | if (! empty($input['name'])) { |
||
30 | $args['DTT_name'] = sanitize_text_field($input['name']); |
||
31 | } |
||
32 | |||
33 | if (! empty($input['description'])) { |
||
34 | $args['DTT_description'] = sanitize_text_field($input['description']); |
||
35 | } |
||
36 | |||
37 | if (! empty($input['endDate'])) { |
||
38 | $args['DTT_EVT_start'] = sanitize_text_field($input['startDate']); |
||
39 | } |
||
40 | |||
41 | if (! empty($input['endDate'])) { |
||
42 | $args['DTT_EVT_end'] = sanitize_text_field($input['endDate']); |
||
43 | } |
||
44 | |||
45 | // Likewise the other fields... |
||
46 | |||
47 | return $args; |
||
48 | } |
||
49 | } |
||
50 |