WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get this to work, but it doesn't. What is wrong?

$tutorgeocodesrc = "http://where.yahooapis.com/geocode?location=" . urlencode($tutoraddressfull) . "&appid=...";
$tutorgeocode    = simplexml_load_file($tutorgeocodesrc);
$tutorlat        = $tutorgeocode->Result[0]->latitude;
$tutorlng        = $tutorgeocode->Result[0]->longitude;
foreach($tutorgeocode->Result[0]->latitude as $child) 
    update_post_meta($user_id, 'tutorcords', $tutorlat);
share|improve this question

On which hook of WP init this code part?

$user_id - why and from how is this var value? update_post_meta() will use the post ID, see Codex.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.