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);
}
I am trying to get this to work, but it doesn't. What is wrong?
$tutorgeocodesrc = "http://where.yahooapis/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
edited Aug 8, 2012 at 15:01
fuxia♦
107k39 gold badges255 silver badges459 bronze badges
asked Aug 8, 2012 at 14:41
WernerWerner
1
0
1 Answer
Reset to default 0On 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.