WP REST User free WordPress plugin
Description
WP REST User free WordPress plugin
If you wish to ‘Register User’ or ‘Retrieve Password’ using REST API, without exposing Administrator credentials to the Front End application, you are at the right place. Since WordPress 4.7, REST API was natively included in WordPress.
In order to ‘Register User’ or ‘Retrieve Password’, the authentication for a user with ‘Administrator’ role is required. While this is a delibrately done for security reasons, such implementation makes it very hard for Front End applications to implement a simple ‘Register’ or ‘Sign Up’ function.
This plugin fullfills such requirement by extending the existing WordPress REST API endpoints.
Usage
Register a User
To Register a User using REST API, send a POST request to /wp-json/wp/v2/users/register, with a JSON body (Set header: content-type: application/json):
{ “username”: “your-username”, “email”: “username@test.com”, “password”: “0000”, }
If successful, you should receive the following response
{ “code”: 200, “id”: 13, “message”: “User ‘your-username’ Registration was Successful” }
To perform further actions after user is registered, write and add_action:
add_action(‘wp_rest_user_user_register’, ‘user_registered’); function user_registered($user) { // Do Something }
Reset Password
To Retrieve Password using REST API, send a POST request to “/wp-json/wp/v2/users/lost-password`, including a JSON body (Set header: content-type: application/json):
{ “user_login”: “username@test.com” } user_login can be either user’s username or email.
If successful, you should receive the following response
{ “code”: 200, “message”: “Reset Password link has been sent to your email.” }
See the Screenshot below for POSTMAN demo:
Technical Support
SK8Tech – Customer Success Specialist offers Technical Support to configure or install WP REST User.
Our Services
SK8Tech Sydney Web Design
SK8Tech Enterprise Email Hosting
SK8Tech Emergency IT Support
SK8Tech WeChat Advertising
Contact Us
Based in Sydney, SK8Tech is a innovative company providing IT services to SMEs, including Web Design, App Development and more.