Forked from woogist/wc_shipment_tracking_add_custom_provider.php
Created
March 26, 2019 22:40
-
-
Save woogists/482a79494f6def6b127326af5057b0d6 to your computer and use it in GitHub Desktop.
Shipment Tracking: adds custom provider
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_filter( 'wc_shipment_tracking_get_providers' , 'wc_shipment_tracking_add_custom_provider' ); | |
/** | |
* wc_shipment_tracking_add_custom_provider | |
* | |
* Adds custom provider to shipment tracking | |
* Change the country name, the provider name, and the URL (it must include the %1$s) | |
* Add one provider per line | |
*/ | |
function wc_shipment_tracking_add_custom_provider( $providers ) { | |
$providers['France']['Provider Name 1'] = 'http://url.com?id=%1$s'; | |
$providers['Ireland']['Provider name 2'] = 'http://url.com?id=%1$s'; | |
// etc... | |
return $providers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FATAL ERROR syntax error, unexpected 'add_filter' (T_STRING) on line number 3