Hi Gustavo,
The use of tribe_get_event() returns a fatal call to undefined function. I believe you want to use tribe_events_get_event() instead. Also the function is comparing the publish date. It should be comparing the event end date. I modified to below, but it’s still not working. I var_dump and $event->end_date returns null even if the event has a specified end date.
function tribe_is_past_event( $event_id = null ){
if ( ! tribe_is_event( $event_id ) ){
return false;
}
$event = tribe_events_get_event( $event_id );
return time() > strtotime( $event->end_date );
}