When associating Eventbrite tickets to your events, you might get into a situation where the ticket form is too short to make the fields visible on your events.

In this article, we will explore how to adjust the ticket form with a code snippet to make it taller than the default height.

The snippet

You can use the following code snippet, and adjust the $intended_height variable (if needed) to make your Eventbrite ticket fields fit to the form container in order to make the ticket fields visible on your events.

add_filter ( 'tribe_events_eventbrite_iframe_height', function ( $iframe_height, $post_id, $event, $num_visible_tickets ) {
   $intended_height = 400 + 160 * $num_visible_tickets;
   if ( $iframe_height < $intended_height ) {
      $iframe_height = $intended_height;
   }   
   return $iframe_height;
}, 100, 4 );

Add the code snippet to the functions.php file of your theme, or use your preferred method for integrating snippets into your WordPress site, such as the free Code Snippets plugin.

For Developers