clean up files to put get_events in main file instead of add_to_scripts

This commit is contained in:
lenovo
2022-11-09 14:45:09 +01:00
parent 80c1683904
commit 2a759d1d86
8 changed files with 106 additions and 52 deletions

View File

@@ -125,7 +125,7 @@ function mp_get_published_posts() {
return $posts_published;
}
function mp_fill_fields_value($id, &$pays) {
function mp_fill_fields_value($id) {
/*
* get_field is an ACF function
@@ -164,11 +164,11 @@ function mp_fill_fields_value($id, &$pays) {
return $event;
}
function mp_get_published_events(&$pays) {
function mp_get_published_events() {
$posts_list = mp_get_published_posts();
$events = [];
foreach ($posts_list as $post) {
$event = mp_fill_fields_value($post->ID, $pays);
$event = mp_fill_fields_value($post->ID);
$event->id = $post->ID;
$event->title = $post->post_title;
array_push($events, $event);