Last active
October 9, 2019 06:27
-
-
Save rafsuntaskin/2f0f9360754c00a253d1065ea54b1735 to your computer and use it in GitHub Desktop.
Fix WooCommerce Email conflict with ET+
This file contains hidden or 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 | |
add_action( 'wp_loaded', 'rt_remove_ticket_email', 80 ); | |
/** | |
* Remove the main filter of ET email and add it again with a check to prevent fatal errors | |
*/ | |
function rt_remove_ticket_email() { | |
if ( ! function_exists( 'tribe' ) ) { | |
return; | |
} | |
remove_filter( 'woocommerce_email_classes', array( tribe( 'tickets-plus.commerce.woo' ), 'add_email_class_to_woocommerce' ) ); | |
add_filter( 'woocommerce_email_classes', function ( $classes ) { | |
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Email' ) ) { | |
return $classes; | |
} | |
$classes['Tribe__Tickets__Woo__Email'] = new Tribe__Tickets_Plus__Commerce__WooCommerce__Email(); | |
return $classes; | |
} ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is deprecated since Event Tickets v4.10.8