Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_user_email($user_id = null) {
- $user = \get_user_by('id', $user_id);
- $metas = \get_user_meta($user_id);
- $email = \get_the_author_meta('user_email', $user_id);
- return isset($metas['user_email']) && !empty($metas['user_email']) ? $metas['user_email'][0] : (!empty($email) ? $email : $user->user_email);
- };
Add Comment
Please, Sign In to add comment