Fires after the user has successfully logged in.
Parameters
Source
do_action( 'wp_login', $user->user_login, $user );
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |
| CARVIEW |
Fires after the user has successfully logged in.
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);
?>
do_action( 'wp_login', $user->user_login, $user );
| Used by | Description |
|---|---|
wp_signon()wp-includes/user.php | Authenticates and logs a user in with ‘remember’ capability. |
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |
You must log in before being able to contribute a note or feedback.
Sending a welcome email to first time logged in users.