times
This commit is contained in:
10
README.md
10
README.md
@@ -126,11 +126,11 @@
|
|||||||
- end: 12h45
|
- end: 12h45
|
||||||
- len: 3h00
|
- len: 3h00
|
||||||
- begin: 15h15
|
- begin: 15h15
|
||||||
- mes: ""
|
- mes: "create plugin menu"
|
||||||
- end: h
|
- end: 19h30
|
||||||
- len: 3h
|
- len: 4h15
|
||||||
- total: h
|
- total: 7h15
|
||||||
- money: €
|
- money: 217€50
|
||||||
|
|
||||||
|
|
||||||
#### total : 90 + 30 = 120€
|
#### total : 90 + 30 = 120€
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ function post_published_coordinates($id, $post) {
|
|||||||
mp_console_log("location: ");
|
mp_console_log("location: ");
|
||||||
mp_console_log($location);
|
mp_console_log($location);
|
||||||
|
|
||||||
// if ( ! add_post_meta( $id, 'location', $location, true ) )
|
if ( ! add_post_meta( $id, 'location', $location, true ) )
|
||||||
// update_post_meta( $id, 'location', $location );
|
update_post_meta( $id, 'location', $location );
|
||||||
|
|
||||||
}
|
}
|
||||||
add_action( 'publish_post', 'post_published_coordinates', 10, 2 );
|
add_action( 'publish_post', 'post_published_coordinates', 10, 2 );
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ function mp_have_no_coordinates($posts_list) {
|
|||||||
$posts_no_coordinates = [];
|
$posts_no_coordinates = [];
|
||||||
foreach ($posts_list as $post) {
|
foreach ($posts_list as $post) {
|
||||||
$location = get_field("location", $post->ID);
|
$location = get_field("location", $post->ID);
|
||||||
mp_console_log("location: ");
|
|
||||||
mp_console_log($location);
|
|
||||||
if (empty($location))
|
if (empty($location))
|
||||||
array_push($posts_no_coordinates, $post);
|
array_push($posts_no_coordinates, $post);
|
||||||
else if (empty($location->coordinates))
|
else if (empty($location->coordinates))
|
||||||
@@ -148,18 +146,18 @@ function mp_show_list_posts_no_coordinates($posts) {
|
|||||||
function ljdp_map_plugin_content() {
|
function ljdp_map_plugin_content() {
|
||||||
|
|
||||||
$posts_list = mp_get_all_posts();
|
$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_published = mp_posts_published($posts_list);
|
||||||
|
|
||||||
$posts_no_address = mp_have_no_address($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);
|
$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
|
echo <<<HTML
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -31,7 +31,11 @@ function mp_get_coordinates($id) {
|
|||||||
. '?language=fr'
|
. '?language=fr'
|
||||||
. '&address=' . urlencode($address)
|
. '&address=' . urlencode($address)
|
||||||
. '&key=' . $mp_api_key;
|
. '&key=' . $mp_api_key;
|
||||||
|
mp_console_log("geolocation:");
|
||||||
|
mp_console_log($geolocation);
|
||||||
$jsoncontent = file_get_contents($geolocation);
|
$jsoncontent = file_get_contents($geolocation);
|
||||||
|
mp_console_log("jsoncontent:");
|
||||||
|
mp_console_log($jsoncontent);
|
||||||
|
|
||||||
// extract coordinates from json
|
// extract coordinates from json
|
||||||
// https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types
|
// https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types
|
||||||
|
|||||||
Reference in New Issue
Block a user