add_filter( 'vcex_grid_query', function( $args ) {
$exclude_past_events = array(
'key' => '_EventStartDate',
'value' => date( 'Y-m-d' ) . ' 00:00:00',
'compare' => '>=',
'type' => 'DATETIME'
);
if ( isset( $args[ 'meta_query' ] ) && is_array( $args[ 'meta_query' ] ) ) {
$args[ 'meta_query' ][] = $exclude_past_events;
} else {
$args[ 'meta_query' ] = array( $exclude_past_events );
}
return $args;
} );
Snippets: Exclude Passed Events (Events Calendar Plugin) from Total Modules
All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)