admin管理员组文章数量:1406943
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.
本文标签: How to update post meta with xml data
版权声明:本文标题:How to update post meta with xml data 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744669806a2618757.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论