FooEvents Recurring Events only show future events

I am using the FooEvents suite with WooCommerce for booking dance classes. I am using the recurring events option as the classes are every week and putting them in one at a time is very time consuming.

However once a class has passed it’s date it still shows in the list of events. I am using the shortcode to show the events in different places on the site. The options in FooEvents to expire a post only work for the whole post and not for each date within a recurring event.

Therefore I am looking for a way to filter the events to only show future options.

I thought I could add a filter, something like this, but it causes a fatal error! Any other suggestions?

 // Create a new filtering function that will add our where clause to the query function filter_where( $  where = '' ) { $  where .= " AND DATE(post_date) >= DATE(NOW())"; return $  where; }  add_filter( 'posts_where', 'filter_where' );