user_register action-hookWP 1.5.0

Fires immediately after a new user is registered.

Usage

add_action( 'user_register', 'wp_kama_user_register_action', 10, 2 );

/**
 * Function for `user_register` action-hook.
 * 
 * @param int   $user_id  User ID.
 * @param array $userdata The raw array of data passed to wp_insert_user().
 *
 * @return void
 */
function wp_kama_user_register_action( $user_id, $userdata ){

	// action...
}
$user_id(int)
User ID.
$userdata(array)
The raw array of data passed to wp_insert_user().

Changelog

Since 1.5.0 Introduced.
Since 5.8.0 The $userdata parameter was added.

Where the hook is called

wp_insert_user()
user_register
wp-includes/user.php 2508
do_action( 'user_register', $user_id, $userdata );

Where the hook is used in WordPress

wp-admin/includes/admin-filters.php 112
add_action( 'user_register', array( 'WP_Internal_Pointers', 'dismiss_pointers_for_new_users' ) );
wp-includes/default-filters.php 110
add_action( $action, 'wp_maybe_update_user_counts', 10, 0 );