<?php

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