dimanche 12 avril 2015

How to display user_meta from form?

I have a form on my website where a user can choose their location from a dropdown list (eg, France, Italy, Germany, etc) when they are writing a post. This is the code used for the LOCATION field:



<?php

$locs = get_user_meta($uid, 'user_location', true);

echo PricerrTheme_get_categories("job_location",
!isset($_POST['job_location_cat']) ? $locs : htmlspecialchars($_POST['job_location_cat'])
, __('Select Location','PricerrTheme'), "do_input"); ?>


I would like the chosen location to be displayed on the user's profile page so people know which country they are from. On this page, I've added this code:



<?php echo $locs = get_user_meta($uid, 'user_location', true); ?>


Unfortunately this only displays the ID number of the location (ie, "3") instead of by name (ie, "Germany"). What do I need to add or remove from this code to get the name of the location to display?


Aucun commentaire:

Enregistrer un commentaire