Skip to content

Instantly share code, notes, and snippets.

/gist.php Secret
Created Feb 27, 2016

Embed
What would you like to do?
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// display a contact form when the event is sold out
// for waitlists
function espresso_clean_event_status( $EVT_ID ) {
$event = EEH_Event_View::get_event( $EVT_ID );
$status = $event instanceof EE_Event ? $event->get_active_status() : 'inactive';
return $status;
}
add_action( 'AHEE_event_details_after_the_content', 'ee_special_sold_out_message' );
function ee_special_sold_out_message( $post ) {
if ( espresso_clean_event_status( $post->ID ) == 'DTE' || espresso_clean_event_status( $post->ID ) == 'DTS' ){
if( function_exists( 'ninja_forms_display_form' ) ){ ninja_forms_display_form( 1 ); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.