Skip to content

Instantly share code, notes, and snippets.

@WooForce
Last active March 31, 2016 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WooForce/b36200453b063513d2ad to your computer and use it in GitHub Desktop.
Save WooForce/b36200453b063513d2ad to your computer and use it in GitHub Desktop.
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