forked from usefulteam/jwt-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass-setup.php
More file actions
35 lines (30 loc) · 800 Bytes
/
class-setup.php
File metadata and controls
35 lines (30 loc) · 800 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
<?php
/**
* Setup JWT Auth.
*
* @package jwt-auth
*/
namespace JWTAuth;
/**
* Setup JWT Auth.
*/
class Setup {
/**
* Setup action & filter hooks.
*/
public function __construct() {
add_action( 'init', array( $this, 'setup_text_domain' ) );
$auth = new Auth();
$devices = new Devices();
add_action( 'rest_api_init', array( $auth, 'register_rest_routes' ) );
add_filter( 'rest_api_init', array( $auth, 'add_cors_support' ) );
add_filter( 'rest_pre_dispatch', array( $auth, 'rest_pre_dispatch' ), 10, 3 );
add_filter( 'determine_current_user', array( $auth, 'determine_current_user' ) );
}
/**
* Setup textdomain.
*/
public function setup_text_domain() {
load_plugin_textdomain( 'jwt-auth', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
}
}