rest_delete_user
Fires immediately after a user is deleted via the REST API.
Description
Parameters (3)
- 0. $user (WP_User)
- The user data.
- 1. $response (WP_REST_Response)
- The response returned from the API.
- 2. $request (WP_REST_Request)
- The request sent to the API.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'rest_delete_user', $user, $response, $request );
- The following example is for adding a hook callback.
- // define the rest_delete_user callback
- function action_rest_delete_user( $user, $response, $request ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'rest_delete_user', 'action_rest_delete_user', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'rest_delete_user', 'action_rest_delete_user', 10, 3 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
- do_action( 'rest_delete_user', $user, $response, $request );