Skip to content

Gravity Forms Integration

Gravity Forms Integration

Collecting attendee details beyond a name and email — meal preferences, accessibility requirements, t-shirt sizes, emergency contacts — requires a form builder. Tickets Please integrates directly with Gravity Forms to render per-attendee registration forms during checkout and RSVP, then stores the submitted data on each attendee record automatically.

The integration activates itself when Gravity Forms is installed. No toggle or settings page is needed. Tickets Please detects Gravity Forms via class_exists( 'GFAPI' ) at runtime and enables the form-linking UI on ticket editor screens.

How It Works

Each ticket can link to one Gravity Form. When a buyer adds that ticket to their cart and proceeds to checkout, Tickets Please renders the linked form once per attendee. If someone buys three tickets, they see three copies of the form — one for each attendee.

The form data flows through this sequence:

  1. Buyer adds tickets to cart and proceeds to checkout.
  2. Tickets Please renders the linked Gravity Form for each attendee slot on the checkout page.
  3. Buyer fills out each form and submits the order.
  4. Tickets Please validates all Gravity Forms submissions as part of WooCommerce checkout validation.
  5. On successful order completion, Gravity Forms entries are created and their entry IDs are stored on the corresponding attendee records.

For RSVP tickets, the same flow happens on the RSVP registration form instead of the WooCommerce checkout page.

Linking a Form to a Ticket

  1. Create your registration form under Forms > New Form in Gravity Forms. Add whatever fields you need — text inputs, dropdowns, checkboxes, file uploads.
  2. Go to the event editor and open the Tickets meta box.
  3. Create a new ticket or edit an existing one.
  4. In the Registration Form dropdown, select the Gravity Form you created.
  5. Set the Attendee Data Collection mode (see below).
  6. Save the ticket.

The form link is stored in the _tec_ticket_gf_form_id meta field on the ticket post.

Attendee Data Collection Modes

Each ticket has an attendee data collection setting (sometimes called IAC — Individual Attendee Collection) that controls when and whether the linked form appears:

ModeBehavior
NoneNo registration form is shown. Attendee records are created with only the buyer’s name and email.
AllowedThe registration form appears during checkout, but fields are optional. Buyers can skip it.
RequiredThe registration form appears and all required fields must be filled out before the order can be completed.

Set the mode in the ticket editor alongside the form selection. If no Gravity Form is linked, the mode setting has no effect.

Checkout Page Behavior

Tickets Please forces the WooCommerce checkout to use the classic checkout layout when Gravity Forms fields need to render. The WooCommerce block-based checkout does not support third-party form injection, so the plugin automatically replaces it with the classic [woocommerce_checkout] shortcode when a cart contains tickets with linked forms.

This switch happens transparently. Buyers see a standard checkout page with the Gravity Forms fields inserted below each attendee section. If no tickets in the cart have linked forms, the block checkout renders normally.

Form Output and HTML Filtering

Gravity Forms renders HTML that includes <input>, <select>, and <option> elements. The standard WordPress wp_kses_post() function strips these form elements because they are not in the post content allowlist. Tickets Please uses wp_kses() with a custom allowlist that permits form elements and their attributes, so the rendered forms display correctly.

If you are building a custom template that outputs Gravity Forms HTML, use wp_kses() with the appropriate allowlist instead of wp_kses_post().

Where Attendee Data Is Stored

After a successful checkout, each attendee record has:

  • The standard attendee fields (name, email, ticket ID, event ID, status)
  • A Gravity Forms entry ID in the _tec_attendee_gf_entry_id meta field
  • The full entry data accessible through the Gravity Forms API using that entry ID

You can view attendee data in the WordPress admin under Events > Attendees, or query it programmatically through the Gravity Forms GFAPI::get_entry() method.

Modifying Form Data Before Save

The tickets_please_gf_form_data filter lets you modify Gravity Forms entry data before it is saved to the attendee record. This is useful for normalizing field values, adding computed fields, or integrating with external systems.

add_filter( 'tickets_please_gf_form_data', function( $entry_data, $attendee_id, $form_id ) {
// Add a computed field based on form responses
$entry_data['custom_field'] = strtoupper( $entry_data[1] ?? '' );
return $entry_data;
}, 10, 3 );

The filter receives the entry data array, the attendee post ID, and the Gravity Form ID.

Common Questions

Do I need Gravity Forms to use Tickets Please? No. Gravity Forms is entirely optional. Without it, attendees are created with the buyer’s name and email from the checkout form. You only need Gravity Forms if you want to collect additional information per attendee.

Can I use different forms for different tickets on the same event? Yes. Each ticket links to its own Gravity Form independently. One event could have a VIP ticket with a detailed registration form and a General Admission ticket with no form at all.

What happens if I delete a Gravity Form that is linked to a ticket? The ticket will no longer show a registration form during checkout. Existing attendee records retain their entry IDs, but the entries themselves will no longer be accessible through the Gravity Forms API.

Can I use Gravity Forms conditional logic in the registration form? Yes. Gravity Forms conditional logic works normally within the rendered form. Fields can show or hide based on other field values, and validation rules apply as configured.

Does the integration work with Gravity Forms add-ons? Standard add-ons that process entries after submission (like notifications, Zapier feeds, and CRM integrations) work as expected because Tickets Please creates standard Gravity Forms entries.

Why does my checkout switch from the block layout to the classic layout? Tickets Please forces the classic checkout when the cart contains tickets with linked Gravity Forms. The WooCommerce block checkout does not support inline third-party forms. Remove the form link from the ticket or empty the cart to restore block checkout.

Next Steps