如何将LatLng从传单添加到WordPress自定义字段

How to add LatLng from leaflet to WordPress custom fields?

本文关键字:添加 WordPress 字段 自定义 LatLng 单添加      更新时间:2023-09-26

我使用传单。我有一个从前端添加帖子的表格。我必须获得当前的latlng坐标,并将它们添加到WordPress自定义字段中。我想我可以使用像这样的输入

document.write('<input type=''text'' name=''position'' value = ''' + latlng + '''');

如何获取变量中的latlng

var positions = document.getElementsByName('position'); //the list of position
var position = positions[i] // the index of position in the document