-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.php
More file actions
37 lines (31 loc) · 754 Bytes
/
utils.php
File metadata and controls
37 lines (31 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
function validate_inputs($input_array) {
foreach ($input_array as $input) {
if (empty($input)) {
return false;
}
}
return true;
}
function check_email($email) {
$posts = get_posts(array(
'post_type' => 'interested_person',
'meta_key' => 'email',
'meta_value' => $email,
));
return count($posts);
}
function find_interested_person($email) {
$interested_person = get_posts(array(
'fields' => 'ids',
'numberposts' => 1,
'post_type' => 'interested_person',
'meta_query' => array(
array(
'key' => 'email',
'value' => $email,
),
),
));
return $interested_person;
}