Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

$tutorgeocodesrc = "" . 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

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.

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.