Forked from xlplugins/Character limitation for Address Fields
Last active
July 9, 2021 12:27
-
-
Save tsbega/532a16cd86a1064f06c6f9bda5b5b4dd to your computer and use it in GitHub Desktop.
Character limitation for Address Fields
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( 'wfacp_forms_field', function($field,$key){ | |
if($key=='billing_number' || $key=='shipping_number'){ | |
$field['custom_attributes']['maxlength']=8; | |
} | |
else{ | |
if($key=='billing_address_2' || $key=='shipping_address_2'){ | |
$field['custom_attributes']['maxlength']=25; | |
} | |
} | |
return $field; | |
},10,2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment