delete_user
Fires immediately before a user is deleted from the database.
Использование
add_action( 'delete_user', 'wp_kama_delete_user_action', 10, 3 ); /** * Function for `delete_user` action-hook. * * @param int $id ID of the user to delete. * @param int|null $reassign ID of the user to reassign posts and links to. * @param WP_User $user WP_User object of the user to delete. * * @return void */ function wp_kama_delete_user_action( $id, $reassign, $user ){ // action... }
- $id(int)
- ID of the user to delete.
- $reassign(int|null)
- ID of the user to reassign posts and links to.
По умолчанию: null, for no reassignment - $user(WP_User)
- WP_User object of the user to delete.
Список изменений
С версии 2.0.0 | Введена. |
С версии 5.5.0 | Added the $user parameter. |
Где вызывается хук
wp-admin/includes/user.php 368
do_action( 'delete_user', $id, $reassign, $user );