Last active
May 9, 2022 08:36
-
-
Save shadimanna/588e38721fbdea1dda244e192b7048c0 to your computer and use it in GitHub Desktop.
This file contains 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
add_filter('pr_shipping_dhl_label_args', 'maybe_remove_state', 10, 2); | |
function maybe_remove_state($args, $order_id) { | |
if( isset( $args['shipping_address']['state'] ) && ( strlen( $args['shipping_address']['state'] ) < 2 || strlen( $args['shipping_address']['state'] ) > 20 ) ) { | |
unset($args['shipping_address']['state']); | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment