Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save elimn/a6c629cd375adedcc014 to your computer and use it in GitHub Desktop.
Save elimn/a6c629cd375adedcc014 to your computer and use it in GitHub Desktop.
MT | TEC | Allows customers to access the WooCommerce product page for tickets
<?php
/*
* Causes WooCommerce Ticket product pages to stop redirecting to their event page
* See https://theeventscalendar.com/knowledgebase/selling-tickets-from-the-woocommerce-products-page/
*/
function tribe_wootix_no_hijack() {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
remove_filter( 'post_type_link', array( $woo_tickets, 'hijack_ticket_link' ), 10, 4 );
}
add_action( 'init', 'tribe_wootix_no_hijack' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment