Skip to content

Commit

Permalink
Fix firing wp_login too early
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed May 26, 2024
1 parent 9b7890a commit a987b79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wp-includes/class-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ function ( $logged_in_cookie ) {
// @see https://developer.wordpress.org/reference/functions/wp_set_current_user/
wp_set_current_user( $wp_user->ID, $wp_user->user_login );
wp_set_auth_cookie( $wp_user->ID );
do_action( 'wp_login', $wp_user->user_login, $wp_user );
add_action(
'init',
function () use ( $wp_user ) {
do_action( 'wp_login', $wp_user->user_login, $wp_user );
}
);

$this->logger->info( "User wp_user:{$wp_user->ID} logged in via {$user_array['source']}." );

Expand Down

0 comments on commit a987b79

Please sign in to comment.