Skip to content

Instantly share code, notes, and snippets.

@rayflores
Created September 12, 2014 06:28
Show Gist options
  • Save rayflores/38d0a0c0af8d022cfd00 to your computer and use it in GitHub Desktop.
Save rayflores/38d0a0c0af8d022cfd00 to your computer and use it in GitHub Desktop.
Remove filters from Shipment Tracking plugin class
<?php
function remove_filters_from_shipping_class( ) {
if (class_exists('WC_Shipment_Tracking')) {
global $WC_Shipment_Tracking; //globalize class from another plugin
// filters from WC_Shipment_Tracking class - which add the tracking info into the exporter class - needed to remove entire filters
remove_filter( 'wc_customer_order_csv_export_order_headers', array( &$WC_Shipment_Tracking, 'add_tracking_info_to_csv_export_column_headers' ) );
remove_filter( 'wc_customer_order_csv_export_order_row', array( &$WC_Shipment_Tracking, 'add_tracking_info_to_csv_export_column_data' ), 10, 3 );
}
}
add_action('plugins_loaded','remove_filters_from_shipping_class'); // after shipment-tracking plugin has loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment