rest_delete_user
Fires immediately after a user is deleted via the REST API.
Usage
add_action( 'rest_delete_user', 'wp_kama_rest_delete_user_action', 10, 3 ); /** * Function for `rest_delete_user` action-hook. * * @param WP_User $user The user data. * @param WP_REST_Response $response The response returned from the API. * @param WP_REST_Request $request The request sent to the API. * * @return void */ function wp_kama_rest_delete_user_action( $user, $response, $request ){ // action... }
- $user(WP_User)
- The user data.
- $response(WP_REST_Response)
- The response returned from the API.
- $request(WP_REST_Request)
- The request sent to the API.
Changelog
Since 4.7.0 | Introduced. |
Where the hook is called
rest_delete_user
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php 955
do_action( 'rest_delete_user', $user, $response, $request );