Action hook 'wp_update_user'

in WP Core File wp-includes/user.php at line 2884

View Source

wp_update_user

Action Hook
Description
Fires after the user has been updated and emails have been sent.

Hook Information

File Location wp-includes/user.php View on GitHub
Hook Type Action
Line Number 2884

Hook Parameters

Type Name Description
int $user_id The ID of the user that was just updated.
array $userdata The array of user data that was updated.
array $userdata_raw The unedited array of user data that was updated.

Usage Examples

Basic Usage
<?php
// Hook into wp_update_user
add_action('wp_update_user', 'my_custom_function', 10, 3);

function my_custom_function($user_id, $userdata, $userdata_raw) {
    // Your custom code here
}

Source Code Context

wp-includes/user.php:2884 - How this hook is used in WordPress core
<?php
2879  	 *
2880  	 * @param int   $user_id      The ID of the user that was just updated.
2881  	 * @param array $userdata     The array of user data that was updated.
2882  	 * @param array $userdata_raw The unedited array of user data that was updated.
2883  	 */
2884  	do_action( 'wp_update_user', $user_id, $userdata, $userdata_raw );
2885  
2886  	return $user_id;
2887  }
2888  
2889  /**

PHP Documentation

<?php
/**
	 * Fires after the user has been updated and emails have been sent.
	 *
	 * @since 6.3.0
	 *
	 * @param int   $user_id      The ID of the user that was just updated.
	 * @param array $userdata     The array of user data that was updated.
	 * @param array $userdata_raw The unedited array of user data that was updated.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.