filters are sorted

This commit is contained in:
lenovo
2022-11-10 14:27:52 +01:00
parent 0f4eb2bd84
commit 0520590230
2 changed files with 36 additions and 8 deletions

View File

@@ -151,6 +151,8 @@ function mp_fill_fields_value($id) {
$event = (object)[];
foreach($fields as $field) {
$value = get_field($field, $id);
if (gettype($value) == "string")
$value = trim($value, " ");
$event->$field = $value;
}
@@ -169,7 +171,7 @@ function mp_get_published_events() {
foreach ($posts_list as $post) {
$event = mp_fill_fields_value($post->ID);
$event->id = $post->ID;
$event->title = $post->post_title;
$event->title = trim($post->post_title, " ");
array_push($events, $event);
}
mp_console_log("events:");