Update class-opalestate-api.php
This commit is contained in:
parent
b8c6530801
commit
c270a835c4
@ -20,7 +20,7 @@ class Opalestate_API {
|
|||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
add_filter( 'jwt_auth_token_before_dispatch', [ $this, 'jwt_auth_token_before_dispatch' ] );
|
add_filter( 'jwt_auth_token_before_dispatch', [ $this, 'jwt_auth_token_before_dispatch' ], 10, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,7 +96,7 @@ class Opalestate_API {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function jwt_auth_token_before_dispatch( $data, $user ) {
|
public function jwt_auth_token_before_dispatch( $data, $user ) {
|
||||||
$data['user_role'] = $user->data->display_name;
|
$data['user_role'] = $user->roles;
|
||||||
$data['avatar'] = opalestate_get_user_meta( $user->data->ID, 'avatar' );
|
$data['avatar'] = opalestate_get_user_meta( $user->data->ID, 'avatar' );
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
|
Loading…
Reference in New Issue
Block a user