Action
wp_login
On this page
Fires the WordPress core wp_login action when RestroPress logs a user in.
rpress_log_user_in sets the auth cookie and current user, then calls do_action with the core wp_login hook so plugins listening for logins also run for logins made through RestroPress forms or checkout. The arguments match core: the user login and the WP_User object.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$user_login | string | The user's login name. |
$user | WP_User|false | The user object for the logged-in user. |
Example#
function my_record_last_login( $user_login, $user ) {
update_user_meta( $user->ID, 'my_last_login', time() );
}
add_action( 'wp_login', 'my_record_last_login', 10, 2 );
Notes#
This is a WordPress core hook. RestroPress fires it manually, in addition to core's own firing in wp_signon.
Source#
Fired from:
includes/login-register.php(line 103), inrpress_log_user_in()
See also#
Was this page helpful?
