I will approach like this:
global $current_user;
get_currentuserinfo();
$email = (string) $current_user->user_email;
var_dump($email);
You just called got the email from the current_user array and cast it into string 🙂 that’s it
I will approach like this:
global $current_user;
get_currentuserinfo();
$email = (string) $current_user->user_email;
var_dump($email);
You just called got the email from the current_user array and cast it into string 🙂 that’s it