INVP::fetch_latitude_and_longitude( int $location_term_id )

fetch_latitude_and_longitude


Description Description

Given the ID of a term in the locations taxonomy, this method returns an object with members <code>lat</code> and <code>lon</code> that contain latitude and longitude coordinates of the address. If the coordinates are saved in meta keys <code>address_lat</code> and <code>address_lon</code>, those are provided. If no coordinates are saved, it bounces the address off OpenStreetMap.org to see if that service knows where the address is located. If coordinates cannot be found, false is returned.


Top ↑

Parameters Parameters

$location_term_id

(Required) The ID of a term in the locations taxonomy


Top ↑

Return Return

(object|false) An object with members "lat" and "lon" or false


Top ↑

Source Source

File: includes/class-invp.php