id; mp_console_log($event_id); $fields = get_fields($event_id); mp_console_log($fields); // foreach( $fields as $name => $value ) // mp_console_log($name . " : " . $value); } $locations = mp_sort_events($events); // mp_get_locations.php mp_console_log("locations :"); mp_console_log($locations); foreach ($locations as $location) mp_console_log($location); $filters = mp_get_filters($events); // mp_get_filters.php // if post event instead of map page, change coordinate and zoom mp_post_event_pages_setting(); mp_add_to_scripts(array( "locations" => $locations, "filters" => $filters, )); return mp_create_div($filters); } add_shortcode('lejourduprof_map', 'mp_ljdp_map'); /** * re-publish posts */ function mp_add_update_button() { return mp_create_republish_button(); } add_shortcode('ljdp_update_publish', 'mp_add_update_button'); /** * errors map */ function mp_errors_map() { return mp_find_address_errors(); } add_shortcode('ljdp_errors_map', 'mp_errors_map'); /** * when a post is saved or published or updated, * find its coordinates function post_published_coordinates($id, $post) { $location = mp_get_coordinates($id); if ( ! add_post_meta( $id, 'location', $location, true ) ) update_post_meta( $id, 'location', $location ); } add_action( 'publish_post', 'post_published_coordinates', 10, 2 ); */ ?>