Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Last active May 18, 2018 15:18
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 barryhughes/bf2105d92acba380364a56b21438c72b to your computer and use it in GitHub Desktop.
Save barryhughes/bf2105d92acba380364a56b21438c72b to your computer and use it in GitHub Desktop.
Remove RSVP ticket form from single events/posts, via code that can be added to a theme's functions.php file (where that's appropriate)
<?php
// This code can be added to a theme's functions.php file to remove
// the frontend ticket form (RSVPs only)
if ( function_exists( 'tribe' ) && class_exists( 'Tribe__Tickets__RSVP' ) ) {
// Remove the RSVP ticket form from blog posts, etc
remove_filter( 'the_content', array(
tribe( 'tickets.rsvp' ), 'front_end_tickets_form_in_content'
), 11 );
// Remove the RSVP ticket form from single event posts
remove_action( 'tribe_events_single_event_after_the_meta', array(
tribe( 'tickets.rsvp' ), 'maybe_add_front_end_tickets_form'
), 5 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment