profile_update
Fires immediately after an existing user is updated.
Usage
add_action( 'profile_update', 'wp_kama_profile_update_action', 10, 3 );
/**
* Function for `profile_update` action-hook.
*
* @param int $user_id User ID.
* @param WP_User $old_user_data Object containing user's data prior to update.
* @param array $userdata The raw array of data passed to wp_insert_user().
*
* @return void
*/
function wp_kama_profile_update_action( $user_id, $old_user_data, $userdata ){
// action...
}
- $user_id(int)
- User ID.
- $old_user_data(WP_User)
- Object containing user's data prior to update.
- $userdata(array)
- The raw array of data passed to wp_insert_user().
Changelog
| Since 2.0.0 | Introduced. |
| Since 5.8.0 | The $userdata parameter was added. |
Where the hook is called
profile_update
wp-includes/user.php 2621
do_action( 'profile_update', $user_id, $old_user_data, $userdata );
Where the hook is used in WordPress
wp-admin/includes/admin-filters.php 125
add_action( 'profile_update', 'default_password_nag_edit_user', 10, 2 );