deleted_user WordPress Action Hook
The deleted_user hook is called whenever a user is deleted from the WordPress site. It allows you to perform any actions that need to be taken when a user is deleted, such as cleaning up any data that was associated with the user.
do_action( 'deleted_user', int $id , int|null $reassign , WP_User $user ) #
Fires immediately after a user is deleted from the database.
Parameters
More Information
The deleted_user action/hook can be used to perform additional actions after a user is deleted. For example, you can delete rows from custom tables created by a plugin.
This hook runs after a user is deleted. The hook delete_user (delete vs deleted) runs before a user is deleted. Choose the appropriate hook for your needs. If you need access to user meta or fields from the user table, use delete_user.
Source
Changelog
Version | Description |
---|---|
5.5.0 | Added the $user parameter. |
2.9.0 | Introduced. |