Refactor tribe_events_event_classes function so it doesn't destroy the global $post
Updates #26953
Minor code improvement
Updates #26953