rest_delete_user хук-событиеWP 4.7.0

Fires immediately after a user is deleted via the REST API.

Использование

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.

Список изменений

С версии 4.7.0 Введена.

Где вызывается хук

WP_REST_Users_Controller::delete_item()
rest_delete_user
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php 948
do_action( 'rest_delete_user', $user, $response, $request );

Где используется хук в WordPress

Использование не найдено.