Use external API data in Query Loop

Hi all,

I’m trying to use API data (from Ticket Tailor) in a query loop.

The API is working and I can render data from it into pages, however I can’t seem to get it working with the query loop. The issue is that my dynamic data always renders as plain text on the frontend. It does have the right amount of entries/loops (2) but no rendered content.

I’ve tried creating some test data to debug this but get the same result with that. I’m sure I’m missing something obvious here, please help!

Test -

add_filter("bricks/setup/control_options", function($options) {
    $options["queryTypes"]["my_fake_query"] = "My Fake Query";
    return $options;
});

add_filter("bricks/query/run", function($results, $query_obj) {
    if ($query_obj->object_type !== "my_fake_query") return $results;

    $fake_data = [
        ['id' => 1, 'name' => 'Event A'],
        ['id' => 2, 'name' => 'Event B'],
    ];

    $loop_items = [];
    foreach ($fake_data as $item) {
        $obj = (object)$item;
        $obj->ID         = $obj->id;
        $obj->post_title = $obj->name;
        $loop_items[]    = $obj;
    }
    return $loop_items;
}, 20, 2);

Thanks very much!