Skip to content
Docs
Get RestroPress

Action

wp_login

Updated
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#

ParameterTypeDescription
$user_loginstringThe user's login name.
$userWP_User|falseThe 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), in rpress_log_user_in()

See also#

Was this page helpful?