do_action( 'wp_login', string $user_login , WP_User $user )
Fires after the user has successfully logged in.
Parameters
More Information
The wp_login
action hook is triggered when a user logs in by the wp_signon() function. It is the very last action taken in the function, immediately following the wp_set_auth_cookie() call.
This hook provides access to two parameters: $user->user_login (string) and $user ( WP_User ). To pass them into your function you will need to add a priority (default is 10) and request 2 arguments from the add_action() call:
<?php
function your_function( $user_login, $user ) {
// your code
}
add_action('wp_login', 'your_function', 10, 2);
?>
Source
File: wp-includes/user.php
.
View all references
do_action( 'wp_login', $user->user_login, $user );
Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Sending a welcome email to first time logged in users.