Skip to content

Instantly share code, notes, and snippets.

@WooForce

WooForce/functions.php

Last active Mar 31, 2016
Embed
What would you like to do?
Exclude undesired First Class Mail services on WooForce USPS Plugin
// Exclude the services First-Class Mail Postcards, First-Class Mail Large Envelope and First-Class Mail Stamped Letter
add_filter('usps_disable_first_class_rate_first-class-mail-postcards', 'disable_first_class_rate_for_this_service',10,3);
add_filter('usps_disable_first_class_rate_first-class-mail-large-envelope', 'disable_first_class_rate_for_this_service',10,3);
add_filter('usps_disable_first_class_rate_first-class-mail-stamped-letter', 'disable_first_class_rate_for_this_service',10,3);
function disable_first_class_rate_for_this_service() {
return true;
}
// Include First-Class Mail Parcel ( Default Behaviour)
add_filter('usps_disable_first_class_rate_first-class-mail-parcel', 'disable_first_class_rate_for_parcel_service',10,3);
function disable_first_class_rate_for_parcel_service() {
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment