wip prevent post publish if wrong coordinates
This commit is contained in:
@@ -127,7 +127,7 @@ function mp_get_published_posts() {
|
||||
return $posts_published;
|
||||
}
|
||||
|
||||
function mp_fill_fields_value($post, $id, &$pays) {
|
||||
function mp_fill_fields_value($id, &$pays) {
|
||||
|
||||
/*
|
||||
* get_field is an ACF function
|
||||
@@ -170,9 +170,15 @@ 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 = mp_fill_fields_value($post->ID, $pays);
|
||||
$event->id = $post->ID;
|
||||
$event->title = $post->post_title;
|
||||
// TEMP
|
||||
if (strlen($event->pays) == 0) {
|
||||
mp_console_log("pays nulle:");
|
||||
mp_console_log($event);
|
||||
}
|
||||
//
|
||||
array_push($events, $event);
|
||||
}
|
||||
mp_console_log("nombre de posts: " . count($events));
|
||||
|
||||
Reference in New Issue
Block a user