Skip to content

Instantly share code, notes, and snippets.

/gist.php Secret

Created February 27, 2016 23:42
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 anonymous/b714865100284d6177e0 to your computer and use it in GitHub Desktop.
Save anonymous/b714865100284d6177e0 to your computer and use it in GitHub Desktop.
<?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