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);

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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