Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created April 23, 2020 01:52
Show Gist options
  • Save joshfeck/00dcad9b8c2cab55285afeb5e3cfb068 to your computer and use it in GitHub Desktop.
Save joshfeck/00dcad9b8c2cab55285afeb5e3cfb068 to your computer and use it in GitHub Desktop.
Show a message when it's an expired event. Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE_event_details_after_event_date',
function($post) {
$event = EEH_Event_View::get_event($post->id);
$status = $event instanceof EE_Event ? $event->get_active_status() : '';
if ($status == 'DTE') {
echo '<h4>This event is expired and not part of the 2020 schedule.</h4>';
}
},
10
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment