Created
August 22, 2018 18:19
-
-
Save joshfeck/a4bf882c0feb79459d15b2f9294b84f4 to your computer and use it in GitHub Desktop.
Filter the Event Espresso upcoming events widget so it only includes events where their first datetime has not started yet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( 'FHEE__EEW_Upcoming_Events__widget__where', 'my_custom_events_widget_where_params', 10, 3 ); | |
function my_custom_events_widget_where_params( $where, $category, $show_expired ) { | |
if ( ! $show_expired ) { | |
$where['Datetime.DTT_EVT_start'] = array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_start' ) ); | |
$where['Datetime.DTT_order'] = 1; | |
} | |
return $where; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment