wpf_get_current_user()

wpf_get_current_user()

#Overview
This function works similarly to the wp_get_current_user function, but it will also work during an auto-login session.
The function will return a WP_User object, or false if the user isn』t known.
#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?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注