Created
May 20, 2014 19:08
-
-
Save joshfeck/8cadf4daa54b9feef721 to your computer and use it in GitHub Desktop.
Modifies the Event Espresso calendar query to include events that have not ended yet when show_expired=false is set
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 // remove if there's already an opening PHP tag in your funcitons.php file | |
add_filter ( 'filter_hook_espresso_calendar_sef_and_start_end_dates', 'my_custom_calendar_query_not_yet_ended' ); | |
function my_custom_calendar_query_not_yet_ended() { | |
// this will filter the query so events that have closed for registration, but haven't ended yet, | |
// will display when show_expired is false | |
$today = date( 'Y-m-d' ); | |
$sql = " AND e.end_date >= '$today' "; | |
return $sql; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment