how to get specific fields from get_user_meta()

The function’s arguments are as follows: user ID, custom field name (meta key), data return method (optional).

So if you wanted to grab data in usermeta with the key of ‘member_zip_code’, you would run:

get_user_meta( $user_id, 'member_zip_code', true );

Alternatively, in your prior method, you could grab the additional data like this:

$data = get_user_meta ( $user_id);

$data['member_zip_code'][0];

Leave a Comment