Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tamarazuk/03f97a46d71bdb7a647f9151bb49a18b to your computer and use it in GitHub Desktop.
Save tamarazuk/03f97a46d71bdb7a647f9151bb49a18b to your computer and use it in GitHub Desktop.
facebook-for-wc-disable-tracking-admin-purchases.php
<?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