-
Notifications
You must be signed in to change notification settings - Fork 1
/
example-use.php
39 lines (33 loc) · 1.08 KB
/
example-use.php
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
38
39
<?php
add_action('init', 'zkapi_example_parking_type');
function zkapi_example_parking_type() {
$args = array(
'public' => true,
'show_in_rest' => true,
'supports' => array('title', 'author', 'comments'),
'label' => 'Parking',
);
register_post_type('parking', $args);
$args = array(
'public' => true,
'show_in_rest' => true,
'supports' => array('title', 'author'),
'label' => 'Parking Slot',
);
register_post_type('parking_slot', $args);
$args = array(
'public' => true,
'show_in_rest' => true,
'supports' => array('title', 'author'),
'label' => 'Réservation',
);
register_post_type('reservation', $args);
}
foreach (['page', 'post', 'parking', 'parking_slot', 'reservation'] as $post_type) {
ZKAPI()->add_post_type($post_type);
}
add_filter('wp_dropdown_users_args', 'add_subscribers_to_dropdown', 10, 2);
function add_subscribers_to_dropdown($query_args, $r) {
$query_args['who'] = '';
return $query_args;
}