wip prevent post publish if wrong coordinates

This commit is contained in:
lenovo
2022-11-08 21:00:05 +01:00
parent cfc747bad3
commit 73d988eb6a
4 changed files with 157 additions and 41 deletions

View File

@@ -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));