I simply wonder why <?php var_dump(get_user_meta(4)); ?> doesn’t contain an email address of the user. Instead I have to use

get_userdata(4)->user_email; to query the email of the user.

Why is that or did I miss something? get_user_meta() seems to provide all other aspects and informations of a user, however just not the email-address.

Matt

2 s
2

get_user_meta retrieves a single meta field or all fields of the user_meta data for the given user.

This means that all the values that are stored in user_meta table can be got using get_user_meta. Email is not stored as meta data so you cant get email using get_user_meta.

Email is stored with username and password in user table as user data.

Leave a Reply

Your email address will not be published. Required fields are marked *