FacetWP – show only upcoming events

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

add_filter( ‘facetwp_query_args’, function( $query_args, $class ) {
if ( ‘events’ == $class->template[‘name’] ) {
$query_args[‘meta_query’] = array(
array(
‘key’ => ‘date’,
‘value’ => current_time( ‘Ymd’ ),
‘compare’ => ‘>=’,
)
);
}
return $query_args;
}, 10, 2 );

{{/gist}}