I have 10 registration forms created for 10 events we hold at random times during the month.
We currently use Event Calendar Pro for our event creation. When I add a new event I just add the shortcode to the event for one of the forms.
I have created two hidden fields in each of the different forms.
1. "{embed_post:post_title}" is the merge tag for the post title - Which happens to always be the name of the event
2. "event_date" and is a dynamically populated field
The "event_date" is populated with a function that gets the Start Date from ECP:
/********************************************************************
Add parameter to Gravity Forms
********************************************************************/
add_filter('gform_field_value_event_date', 'my_custom_population_function');
function my_custom_population_function($value){
return tribe_get_start_date(null, false, 'F j, Y - g:i a');
}
This all works great and when I form is submitted on an event the title of the email is "Event Title - Event Date" so I do not have to keep creating new forms every time we have a new event.
I am now being asked if I can disable/hide the forms for past events. Is there a way to use the function above to determine if the value is past the current date and hide the form?
I was looking at the conditional logic for the form settings maybe I could create a new hidden field to determine if it is in the past and pass a variable of "past-event"? then check the hidden field for that value?