-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
43 lines (30 loc) · 1.1 KB
/
functions.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
40
41
42
43
<?php
//remove_action("rest_api_init", "create_initial_rest_routes", 99);
add_filter("rest_endpoints", function ($endpoints) {
unset($endpoints["/wp/v2/users"]);
unset($endpoints["/wp/v2/users/(?P<id>[\d]+)"]);
return $endpoints;
});
$dirbase = get_template_directory();
require_once $dirbase . "/endpoints/user_post.php";
require_once $dirbase . "/endpoints/user_get.php";
require_once $dirbase . "/endpoints/photo_post.php";
require_once $dirbase . "/endpoints/photo_get.php";
require_once $dirbase . "/endpoints/photo_delete.php";
require_once $dirbase . "/endpoints/comment_post.php";
require_once $dirbase . "/endpoints/comment_get.php";
require_once $dirbase . "/endpoints/stats_get.php";
require_once $dirbase . "/endpoints/password.php";
update_option("large_size_w", 1000);
update_option("large_size_h", 1000);
update_option("large_crop", 1);
function change_api($slug) {
return "json";
}
add_filter("rest_url_prefix", "change_api");
function expire_token() {
return time() + (60 * 60 * 24);
}
add_action("jwt_auth_expire", "expire_token");
// ao criar essa função, o token expira após 24h
?>