do_action( 'deleted_user', int $id, int|null $reassign, WP_User $user )
- Since
- 2.9.0, 5.5.0
Fires immediately after a user is deleted from the site.
Description
Note that on a Multisite installation the user may not have been deleted from the database depending on whether wp_delete_user() or wpmu_delete_user() was called.
Compatibility
- WordPress
- since 5.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$idint- ID of the deleted user.
$reassignint|null- ID of the user to reassign posts and links to.
Default null, for no reassignment. $userWP_User- WP_User object of the deleted user.
Where this hook fires · 2
wp-admin/includes/ms.php:211wpmu_delete_user()wp-admin/includes/user.php:468wp_delete_user()
Source code
* * @param int $id ID of the deleted user. * @param int|null $reassign ID of the user to reassign posts and links to. * Default null, for no reassignment. * @param WP_User $user WP_User object of the deleted user. */ do_action( 'deleted_user', $id, $reassign, $user ); return true;} /** * Remove all capabilities from user.Changelog
Introduced in 2.9.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
5.5.0
Added the
$user parameter.from the docblock2.9.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.