Adding user email address to WP API Rest
-
Hi there,
I need to know the email address asociated with an user id with Api rest request.
I’m performing a get request to “/wp-json/wp/v2/users/2” which returns a lot of information about this userID = 2 but email address is not there.
How can I add this info in the response ?
I tried adding this to functions.php in theme folder but the value still not there.`register_meta( ‘user’, ‘user_email’, [ ‘show_in_rest’ => true ] );
I also read the documentation but I still have problems.
Thanks in advance
Maxi
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding user email address to WP API Rest’ is closed to new replies.