Hi guys,
I’m trying to build a function that, at the click of a button will add the users latitude and longitude to the end of a url, I was wondering what function i could use to echo the current users lat and lon?
This is the kind of code im thinking..
add_action('geodir_detail_page_sidebar' , 'foodnearme', 100);
function foodnearme(){
global $post, $wp_query, $geodirectory;
$lat= geodir_get_user_latitude($??USER_latitude,'??USER_latitude',true); //lat
$lon= geodir_get_user_longitude($??USER_longitude,'??USER_longitude',true); //lon
//echo $e_add.$lat.$lon;
echo "<div class='customfoodnearmebutton'><button><a href="http://urban-fix.co.uk/?geodir_search=1&s=+&snear=Near%3A+User+defined&sgeodir_cuisines%5B%5D=&sgeodir_musicgenre%5B%5D=&sort_by=&sgeo_lat=".$lat."&sgeo_lon=".$lon."" target="_blank"> Open Food and Drink Near You!</a></button></div>";
}
Any advice would be great!
Thanks,
UF