rest_delete_user
Action HookDescription
Fires immediately after a user is deleted via the REST API.Hook Information
File Location |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
View on GitHub
|
Hook Type | Action |
Line Number | 985 |
Hook Parameters
Type | Name | Description |
---|---|---|
WP_User
|
$user
|
The user data. |
WP_REST_Response
|
$response
|
The response returned from the API. |
WP_REST_Request
|
$request
|
The request sent to the API. |
Usage Examples
Basic Usage
<?php
// Hook into rest_delete_user
add_action('rest_delete_user', 'my_custom_function', 10, 3);
function my_custom_function($user, $response, $request) {
// Your custom code here
}
Source Code Context
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:985
- How this hook is used in WordPress core
<?php
980 *
981 * @param WP_User $user The user data.
982 * @param WP_REST_Response $response The response returned from the API.
983 * @param WP_REST_Request $request The request sent to the API.
984 */
985 do_action( 'rest_delete_user', $user, $response, $request );
986
987 return $response;
988 }
989
990 /**
PHP Documentation
<?php
/**
* Fires immediately after a user is deleted via the REST API.
*
* @since 4.7.0
*
* @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.
*/
Quick Info
- Hook Type: Action
- Parameters: 3
- File: wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
Related Hooks
Related hooks will be displayed here in future updates.