<?php

add_filter('timber/context', function($context) {
    $repeater = get_field('editorial', 'options'); 
    if ($repeater) {
        foreach ($repeater as &$item) {
            if (!empty($item['post'])) {
                $item['post'] = Timber::get_post($item['post'], 'BlogPost');
            }
        }
    }
    $context['editorial'] =  $repeater;
    return $context;
});
