我正在通过外部表单更新Google地图字段,但我无法找出正确的格式。我目前有类似的东西:
$value = array(
"address" => $address,
"lat" => '24.739412360143447',
"lng" =>'101.76182085000005');
update_post_meta($post_id,'google_map',$value);
更新Google地图的高级自定义字段的正确格式是什么?
试试这个,希望能工作:)
$field_name = "field_53bdd058c84a8";
$value = array("address" => $address, "lat" => $lat, "lng" => $lng, "zoom" => $zoom);
update_field($field_name, $value, $this_ID);
您可以尝试将'coordinates'替换为'google_map':
$value = array("address" => $address, "lat" => '24.739412360143447', "lng" =>'101.76182085000005');
update_post_meta($post_id, 'coordinates', $value);
this page上有人有类似的问题。