added ip addr

This commit is contained in:
asus
2023-09-22 14:02:55 +02:00
parent f829277d55
commit 31f897056f
6 changed files with 74 additions and 32 deletions

View File

@@ -17,6 +17,7 @@ Author URI:
*/
include_once(dirname(__FILE__) . '/utils/mp_console_log.php');
include_once(dirname(__FILE__) . '/utils/mp_get_ip.php');
require_once(dirname(__FILE__) . '/mp_enqueue.php');
@@ -56,22 +57,10 @@ function mp_ljdp_map() {
mp_enqueue_scripts_and_styles();
$events = mp_get_published_events(); // mp_get_events.php
mp_console_log("events :");
mp_console_log($events);
// foreach ($events as $event) {
// mp_console_log("--------------- event :");
// mp_console_log("id: " . $event->id);
// mp_console_log("adresse: " . $event->adresse);
// mp_console_log("pays: " . $event->pays);
// mp_console_log("ville: " . $event->ville);
// mp_console_log("irl: " . $event->irl);
// mp_console_log($event);
//
// $fields = get_fields($event_id);
// mp_console_log($fields);
// foreach( $fields as $name => $value )
// mp_console_log($name . " : " . $value);
// }
//mp_console_log("events :");
//mp_console_log($events);
//foreach ($events as $event)
// mp_console_log($event);
$locations = mp_sort_events($events); // mp_get_locations.php
@@ -127,8 +116,8 @@ add_shortcode('ljdp_errors_map', 'mp_errors_map');
function post_published_coordinates($id, $post) {
$location = mp_get_coordinates($id);
mp_console_log("location: ");
mp_console_log($location);
//mp_console_log("location: ");
//mp_console_log($location);
if ( ! add_post_meta( $id, 'location', $location, true ) )
update_post_meta( $id, 'location', $location );