times
This commit is contained in:
@@ -45,8 +45,6 @@ function mp_have_no_coordinates($posts_list) {
|
||||
$posts_no_coordinates = [];
|
||||
foreach ($posts_list as $post) {
|
||||
$location = get_field("location", $post->ID);
|
||||
mp_console_log("location: ");
|
||||
mp_console_log($location);
|
||||
if (empty($location))
|
||||
array_push($posts_no_coordinates, $post);
|
||||
else if (empty($location->coordinates))
|
||||
@@ -148,18 +146,18 @@ function mp_show_list_posts_no_coordinates($posts) {
|
||||
function ljdp_map_plugin_content() {
|
||||
|
||||
$posts_list = mp_get_all_posts();
|
||||
mp_console_log("posts_list: ");
|
||||
mp_console_log($posts_list);
|
||||
//mp_console_log("posts_list: ");
|
||||
//mp_console_log($posts_list);
|
||||
|
||||
$posts_published = mp_posts_published($posts_list);
|
||||
|
||||
$posts_no_address = mp_have_no_address($posts_list);
|
||||
mp_console_log("posts_no_address: ");
|
||||
mp_console_log($posts_no_address);
|
||||
//mp_console_log("posts_no_address: ");
|
||||
//mp_console_log($posts_no_address);
|
||||
|
||||
$posts_no_coordinates = mp_have_no_coordinates($posts_list);
|
||||
mp_console_log("posts_no_coordinates: ");
|
||||
mp_console_log($posts_no_coordinates);
|
||||
//mp_console_log("posts_no_coordinates: ");
|
||||
//mp_console_log($posts_no_coordinates);
|
||||
|
||||
echo <<<HTML
|
||||
<div>
|
||||
|
||||
@@ -31,7 +31,11 @@ function mp_get_coordinates($id) {
|
||||
. '?language=fr'
|
||||
. '&address=' . urlencode($address)
|
||||
. '&key=' . $mp_api_key;
|
||||
mp_console_log("geolocation:");
|
||||
mp_console_log($geolocation);
|
||||
$jsoncontent = file_get_contents($geolocation);
|
||||
mp_console_log("jsoncontent:");
|
||||
mp_console_log($jsoncontent);
|
||||
|
||||
// extract coordinates from json
|
||||
// https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types
|
||||
|
||||
Reference in New Issue
Block a user