added bounds to keep view inside map
+ changed marker icon to works unified with cluster
This commit is contained in:
@@ -127,7 +127,7 @@ function mp_get_published_posts() {
|
||||
return $posts_published;
|
||||
}
|
||||
|
||||
function mp_fill_fields_value($id) {
|
||||
function mp_fill_fields_value($post, $id, &$pays) {
|
||||
|
||||
/*
|
||||
* get_field is an ACF function
|
||||
@@ -153,7 +153,8 @@ function mp_fill_fields_value($id) {
|
||||
);
|
||||
$event = (object)[];
|
||||
foreach($fields as $field) {
|
||||
$event->$field = get_field($field, $id);
|
||||
$value = get_field($field, $id);
|
||||
$event->$field = $value;
|
||||
}
|
||||
|
||||
// add mode irl or online (irl: true | false)
|
||||
@@ -165,15 +166,16 @@ function mp_fill_fields_value($id) {
|
||||
return $event;
|
||||
}
|
||||
|
||||
function mp_get_published_events() {
|
||||
function mp_get_published_events(&$pays) {
|
||||
$posts_list = mp_get_published_posts();
|
||||
$events = [];
|
||||
foreach ($posts_list as $post) {
|
||||
$event = mp_fill_fields_value($post, $post->ID, $pays);
|
||||
$event->id = $post->ID;
|
||||
$event->title = $post->post_title;
|
||||
$event = mp_fill_fields_value($post->ID);
|
||||
array_push($events, $event);
|
||||
}
|
||||
mp_console_log("nombre de posts: " . count($events));
|
||||
return $events;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user