Forked from theeventscalendar/WooCommerce-product-page.php
Last active
June 12, 2017 14:59
-
-
Save elimn/a6c629cd375adedcc014 to your computer and use it in GitHub Desktop.
MT | TEC | Allows customers to access the WooCommerce product page for tickets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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