Wordpress if usermeta meta_key exists do this
(TESTED) If you put true
as the last argument, according to documentation, it will return the value of the metadata field. Which means you have to put false
as last argument.
$havemeta = get_user_meta($userID, 'test', false);
Then, as said in the other answer, you can check it
if ($havemeta) echo $havemeta;} else { echo "No";}