Created
June 12, 2020 02:59
-
-
Save tamarazuk/03f97a46d71bdb7a647f9151bb49a18b to your computer and use it in GitHub Desktop.
facebook-for-wc-disable-tracking-admin-purchases.php
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 // only copy this line if needed | |
add_action( 'init', function() { | |
if ( current_user_can( 'manage_options' ) && function_exists( 'facebook_for_woocommerce' ) && isset( facebook_for_woocommerce()->get_integration()->events_tracker ) ) { | |
$event_tracker = facebook_for_woocommerce()->get_integration()->events_tracker; | |
remove_action( 'woocommerce_thankyou', [ $event_tracker, 'inject_purchase_event' ], 40 ); | |
remove_action( 'woocommerce_payment_complete', [ $event_tracker, 'inject_purchase_event' ], 40 ); | |
} | |
}, 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment