Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created February 23, 2017 12:42
Show Gist options
  • Save Pebblo/f6f62ce3d15271bcddd4a05715addab6 to your computer and use it in GitHub Desktop.
Save Pebblo/f6f62ce3d15271bcddd4a05715addab6 to your computer and use it in GitHub Desktop.
Add a Contact Form 7 form to a Sold out Event Espresso 4 event. This is useful if you want to capture names and contact info from people that want to be signed up for a waiting list.
<?php //Please do not include the opening PHP tag if you already have one.
// Display a contact form 7 form when the event is sold out
// to be used as a waiting list
function ee_contact_form_7_waitlist( $EVT_ID, $event ) {
//Check the status of the event.
$status = $event instanceof EE_Event ? $event->get_active_status() : 'inactive';
//If the event is sold out output the contact form 7 form.
if ( ee_espresso_clean_event_status( $event ) == 'DTS' ) {
//The shortcode within the single quotes will be specific for your form.
echo do_shortcode('[contact-form-7 id="107" title="EE Waitlist"]');
}
}
add_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', 'ee_contact_form_7_waitlist', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment