Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active December 11, 2018 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/9507f80867b3b64c4e117bfc4c211389 to your computer and use it in GitHub Desktop.
Save mgibbs189/9507f80867b3b64c4e117bfc4c211389 to your computer and use it in GitHub Desktop.
FacetWP - show only upcoming events
<?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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment