This function works similarly to the wp_get_current_user function, but it will also work during an auto-login session.


(WP_User) Returns a WP_User object or false if no user is found.

#Get the current user

$user = wpf_get_current_user();
if ( false !== $user ) {
	echo $user->user_email; // The email address of the current user, or temporary auto-login user

Was this helpful?